java - Android - How can I display my splash screen graphic larger? -


i can't seem figure out how splash screen graphic display larger, can help? image 288x69 pixel png file, on android device renders tiny , can't figure out how change it. splash screen works perfect, except image size. it's drawn android:drawable in xml, no matter try won't render larger. tips appreciated!

the image added android studio under res/mipmap/.. , xxxhdpi version 192 x 192 pixels after import android studio.

to create splash, in androidmanifest.xml have following:

        <activity         android:name=".splashactivity"         android:theme="@style/splashtheme">         <intent-filter>             <action android:name="android.intent.action.main" />              <category android:name="android.intent.category.launcher" />         </intent-filter>     </activity> 

under res/drawable created background_splash.xml contains this:

<?xml version="1.0" encoding="utf-8"?> 

<item     android:drawable="@color/white"     android:id="@+id/splashdrawable"     android:layout_width="match_parent"     android:layout_height="match_parent"/>   <item>     <bitmap         android:gravity="center"         android:src="@mipmap/my_logo"         android:id="@+id/splashlogo"/>  </item> 

in java folder have splashactivity.java following, causes splash go away when app finished loading:

public class splashactivity extends appcompatactivity {  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);      intent intent = new intent(this, mainactivity.class);     startactivity(intent);     finish(); } 

}

in styles.xml file have this:

  <style name="splashtheme" parent="theme.appcompat.noactionbar">     <item name="android:windowbackground">@drawable/background_splash</item> </style> 

you need image higher resolutions.these days phone displays have around 300dpi less image resolution is. reason seeing small image.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -