Question

I know that the question is rather rare, but also is rare what happens with my app...

I programmed yesterday a presentation activity for my app, which only appears 1,5 seconds before starting the main activity. The presentation activity just load the presentation.xml file in which there only are a LinearLayout with an ImageView and a TextView. This ImageView has attached an image with the logo of my app (.png) and the TextView is just below.

What happens is that when I run the app with the Eclipse emulator I can see perfectly just what I programmed. I see, for 1,5 seconds, a custom background with my logo in the center of the screen and the text below it, but things goes wrong when I try the app in my mobile: the logo is absolutely invisible! It just disappears.

Must say that before setting that image, there were the same logo with less resolution. Also I tried to set the image and the parameters from java code but happens the same and it's so disappointing...

Hope you know what is happening and bring me a good solution... Thank you!


Code affected:

JAVA

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.presentacion_act);

    RelativeLayout lay = (RelativeLayout)findViewById(R.id.back);
    lay.setBackgroundResource(R.drawable.back_presentacion);

XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/darker_gray"
    android:id="@+id/back"
    tools:context=".Presentacion" >

    <ImageView  
      android:id="@+id/lay_class" 
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" 
      android:scaleType="centerInside"
      android:layout_centerVertical="true" 
      android:layout_centerHorizontal="true" 
      android:paddingBottom="70dp" 
      android:paddingLeft="15dp" 
      android:paddingRight="15dp"
      android:src="@drawable/classmarks"/>
Was it helpful?

Solution

Done! Just making the image smaller it runs perfectly on my device.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top