Issue
I have a navigation drawer that is working fine on my app. I recently added a splash screen and it loads ok but a navigation bar is showing up along with an email icon on the bottom right.
I have this on my manifest:
<activity
android:name=".SplashActivity"
android:label="@string/title_activity_splash"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
</activity>
How do I remove these unnecessary tab and icon on the splash screen?
I have this on my splashactivity Java:
package widevalue.com.widevalueautoinc;
import android.content.Intent;
import android.media.Image;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
public class SplashActivity extends AppCompatActivity {
private TextView tv ;
private TextView tv2 ;
private ImageView iv ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
tv = (TextView) findViewById(R.id.tv) ;
tv2 = (TextView) findViewById(R.id.tv2) ;
iv = (ImageView) findViewById(R.id.iv) ;
Animation myanim = AnimationUtils.loadAnimation(this,R.anim.mytransition);
tv.startAnimation(myanim);
tv2.startAnimation(myanim);
iv.startAnimation(myanim);
final Intent i = new Intent(this, MainActivity.class);
Thread timer =new Thread(){
public void run () {
try {
sleep(5000) ;
} catch (InterruptedException e) {
e.printStackTrace();
}
finally {
startActivity(i);
finish();
}
}
};
timer.start();
}
}
Solution
How do I remove these unnecessary tab and icon on the splash screen?
The icon is called FloatingActionButton
. remove the following code from splash activity layout
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
The tab
is called actionbar
. You can remove it using android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
theme for SplashActivity
in manifest
file
Answered By - Ali Ahsan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.