1
Hi, I’m initiating on Android Studio, and I’m having a question.
How to make my splash stay with the image in full screen and without the title bar?
My image PNG has 750 x 1334.
Follows my code:
MANIFESTS: Androidmanifests.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.abmprotege">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"></activity>
</application>
</manifest>
JAVA: Splashactivity
package br.com.site;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(getBaseContext(), MainActivity.class));
finish();
}
}, 5000);
}
}
LAYOUT: activity_splash.html
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".SplashActivity">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="@drawable/splash" />
</LinearLayout>
Hello Murillo, thanks for the help. The title came out, but the image is not yet full. The image is not filling the total width of the app. What I need to do?
– Tiago
@James, I edited my answer, I believe that now the problem will be solved.
– Murillo Comino
Thank you Murilo, I’m starting on Android and had not found anything that would help me to do this...rsrs, thank you very much.
– Tiago
Quiet, it is possible to do this also by java, but I find it more practical by xml rs
– Murillo Comino
Thank you very much.
– Tiago
Can you help me with that? https://answall.com/questions/383075/executar-html5-dentro-do-webview-android
– Tiago
With you in parts @Tiago, I need to test only how to receive the event click by html, I already answer there.
– Murillo Comino
Ahhh, I’m using Webview on android, and accessing the test URL. Let’s talk on the other page of the code to get better. https://answall.com/questions/383136/salvar-imagem-assinada-dentro-do-servidor
– Tiago