CardView disappearing on API 19 - android

I have developed an app that works perfectly on Lollipop. However, I am experiencing some strange glitches on kitkat (api 19)
When I run my app on the kitkat device, it shows my card view for a split second then it disappears.
below is my xml layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
xmlns:fontawesometext="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
tools:context="com.running.mattboyle.runnertoolbox.RunningMap">
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_viewrunning"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/backgroundcard"
card_view:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Chronometer
android:id="#+id/Duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:paddingLeft="10dp"
android:text="0:00"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/Calories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="60dp"
android:text="Calories: 0" />
<TextView
android:id="#+id/pace"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:layout_alignParentRight="true"
android:text="0:00"
android:layout_marginEnd="60dp" />
<TextView
android:id="#+id/paceunits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:text="min/km"
android:layout_alignParentRight="true"
android:layout_marginEnd="10dp" />
<TextView
android:id="#+id/distanceText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#id/Duration"
android:layout_marginTop="52dp"
android:text="0.00"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/distanceUnits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/Duration"
android:layout_marginTop="12dp"
android:layout_marginLeft="5dp"
android:layout_toRightOf="#id/distanceText"
android:text="KM"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="#+id/runButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
android:text="Begin Run"
android:layout_centerInParent="true"
bootstrap:bb_type="primary" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="#+id/pauseButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp"
android:text="Pause"
android:layout_centerHorizontal="true"
android:paddingRight="120dp"
bootstrap:bb_type="warning" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="#+id/EndButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:paddingLeft="120dp"
android:text="End Run"
bootstrap:bb_type="success"
/>
</RelativeLayout>
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"
android:paddingBottom="40dp">
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="#+id/right"
android:layout_width="70dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
bootstrap:bb_type="primary"
fontawesometext:fa_icon="fa-forward"
android:text="Next"
android:layout_alignParentRight="true"
android:layout_marginEnd="10dp" />
<TextView
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Calculating....."
android:id="#+id/runLength"
android:layout_centerHorizontal="true" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:layout_width="70dp"
android:layout_height="wrap_content"
bootstrap:bb_type="primary"
android:text="Last"
fontawesometext:fa_icon="fa-backward"
android:id="#+id/left"
android:layout_alignParentLeft="true"
android:layout_marginStart="10dp" />
</RelativeLayout>
</RelativeLayout>
What's extra weird is I have a cardview on my home screen too that opens and works just fine:
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="#drawable/backgroundcard"
card_view:cardCornerRadius="4dp">
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#drawable/vertical_divider"
android:dividerPadding="12dip"
android:showDividers="middle">
<TextView
android:id="#+id/weather"
android:textColor="#android:color/primary_text_light"
android:paddingTop="10dp"
android:paddingLeft="15dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Weather"
android:textSize="25dp"
/>
<TextView
android:id="#+id/location"
android:textColor="#android:color/darker_gray"
android:paddingTop="130dp"
android:paddingLeft="40dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Birmingham,UK"
/>
<ImageView
android:layout_width="130dp"
android:layout_height="130dp"
android:background="#drawable/nightcloud"
android:layout_marginTop="25dp"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:id="#+id/weatherImage" />
<TextView
android:id="#+id/low"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="05\u00B0"
android:paddingTop="75dp"
android:paddingRight="20dp"
android:layout_alignParentEnd="true"
android:textColor="#android:color/primary_text_light"
/>
<TextView
android:id="#+id/high"
android:textColor="#android:color/primary_text_light"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10\u00B0"
android:paddingTop="95dp"
android:paddingRight="20dp"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/current"
android:textColor="#android:color/darker_gray"
android:textSize="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10\u00B0"
android:paddingRight="50dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/judgement"
android:paddingTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#android:color/darker_gray"
android:text="Wear an underlayer, it is cold!"
android:paddingBottom="5dp"
android:paddingLeft="15dp"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
Log cat doesn't offer any complaints.
Android Studio documents this too:
Api 19
api 21
Any ideas? Would really appreciate any assistance.
EDIT: I tried adding the line findViewById(R.id.card_viewrunning).setVisibility(View.VISIBLE); to no prevail.
Once again, this works perfectly on an api 21 device. Very strange one.

Look at the component tree tab on the right in android studio for your layout in v19. Select your cardview and look on the visual editor, it should be highlighted. My guess is it's hidden behind the fragment.

Related

I do not see the same in Emulator, according to Android Studio's preview or Android phone

I am learning from Udacity, I have learned so far LinearLayout and RelativeLayout. Based on this I tried to create an xml for a project. I created it according to preview from inside Android Studio Nexus 5X. Then when I run this in Emulator Nexus 5X again I see different output the project was created according to API 15. Then when I run it on my Android phone I see it as on preview. Following I will post the outcomes:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageView
android:id="#+id/background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
app:srcCompat="#drawable/background" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/topScore"
android:layout_width="350dp"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_marginBottom="15dp"
android:layout_weight="5">
<ImageView
android:id="#+id/topImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="#drawable/topscore" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="18dp"
android:gravity="center"
android:text="0 - 0"
android:textColor="#android:color/background_light"
android:textSize="26dp" />
<ImageButton
android:id="#+id/arrowRightScore"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="30dp"
android:layout_marginRight="6dp"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<ImageButton
android:id="#+id/arrowLeftScore"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="6dp"
android:layout_marginTop="30dp"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
</RelativeLayout>
<RelativeLayout
android:layout_width="390dp"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_marginBottom="25dp"
android:layout_weight="1">
<ImageView
android:id="#+id/row1"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="#drawable/row" />
<TextView
android:id="#+id/textRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/row1"
android:layout_alignTop="#id/row1"
android:layout_alignRight="#id/row1"
android:layout_alignBottom="#id/row1"
android:layout_margin="1dp"
android:gravity="center"
android:text="SHOTS"
android:textColor="#000000"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowLeftRow1"
android:layout_width="52dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row1"
android:layout_alignRight="#+id/arrowLeftRow1"
android:layout_alignBottom="#id/row1"
android:layout_marginTop="0dp"
android:layout_marginRight="-35dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowRightRow1"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row1"
android:layout_alignBottom="#id/row1"
android:layout_alignParentRight="true"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/arrowRightRow1"
android:layout_alignTop="#id/row1"
android:layout_alignBottom="#id/row1"
android:layout_marginLeft="-45dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="390dp"
android:layout_height="0dp"
android:layout_marginBottom="25dp"
android:layout_weight="1">
<ImageView
android:id="#+id/row2"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="#drawable/row" />
<TextView
android:id="#+id/textRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/row2"
android:layout_alignTop="#id/row2"
android:layout_alignRight="#id/row2"
android:layout_alignBottom="#id/row2"
android:layout_margin="1dp"
android:gravity="center"
android:text="FOULS"
android:textColor="#000000"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowLeftRow2"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row2"
android:layout_alignBottom="#id/row2"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row2"
android:layout_alignRight="#+id/arrowLeftRow2"
android:layout_alignBottom="#id/row2"
android:layout_marginTop="0dp"
android:layout_marginRight="-45dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowRightRow2"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row2"
android:layout_alignBottom="#id/row2"
android:layout_alignParentRight="true"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/arrowRightRow2"
android:layout_alignTop="#id/row2"
android:layout_alignBottom="#id/row2"
android:layout_marginLeft="-45dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="390dp"
android:layout_height="0dp"
android:layout_marginBottom="25dp"
android:layout_weight="1">
<ImageView
android:id="#+id/row3"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="#drawable/row" />
<TextView
android:id="#+id/textRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/row3"
android:layout_alignTop="#id/row3"
android:layout_alignRight="#id/row3"
android:layout_alignBottom="#id/row3"
android:layout_margin="1dp"
android:gravity="center"
android:text="CORNERS"
android:textColor="#000000"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowLeftRow3"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row3"
android:layout_alignBottom="#id/row3"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row3"
android:layout_alignRight="#+id/arrowLeftRow3"
android:layout_alignBottom="#id/row3"
android:layout_marginTop="0dp"
android:layout_marginRight="-45dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowRightRow3"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row3"
android:layout_alignBottom="#id/row3"
android:layout_alignParentRight="true"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/arrowRightRow3"
android:layout_alignTop="#id/row3"
android:layout_alignBottom="#id/row3"
android:layout_marginLeft="-45dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="390dp"
android:layout_height="0dp"
android:layout_marginBottom="25dp"
android:layout_weight="1">
<ImageView
android:id="#+id/row4"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="#drawable/row" />
<TextView
android:id="#+id/textRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/row4"
android:layout_alignTop="#id/row4"
android:layout_alignRight="#id/row4"
android:layout_alignBottom="#id/row4"
android:layout_margin="1dp"
android:gravity="center"
android:text="OFFSIDES"
android:textColor="#000000"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowLeftRow4"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row4"
android:layout_alignBottom="#id/row4"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row4"
android:layout_alignRight="#+id/arrowLeftRow4"
android:layout_alignBottom="#id/row4"
android:layout_marginTop="0dp"
android:layout_marginRight="-45dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
<ImageButton
android:id="#+id/arrowRightRow4"
android:layout_width="35dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/row4"
android:layout_alignBottom="#id/row4"
android:layout_alignParentRight="true"
android:background="#android:color/transparent"
android:src="#android:drawable/arrow_up_float" />
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/arrowRightRow4"
android:layout_alignTop="#id/row4"
android:layout_alignBottom="#id/row4"
android:layout_marginLeft="-45dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"
android:gravity="center"
android:text="0"
android:textColor="#ffff"
android:textSize="18dp" />
</RelativeLayout>
<Button
android:id="#+id/buttonReset"
android:layout_width="150sp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_margin="50dp"
android:layout_marginBottom="5dp"
android:layout_weight="0.5"
android:background="#drawable/reset"
android:text="RESET"
android:textColor="#cdc2b1"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
What I get from preview:
What I get from Emulator:
What I get from my Android Phone:
I found that I have used on top
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:orientation="vertical">
That pushed 10dp the layout inside. Then I used static 390dp in RelativeLayout and that probably pushed outside the image living the arrows out of place.
<RelativeLayout
android:layout_width="390dp"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_marginBottom="25dp"
android:layout_weight="1">
By removing android:layout_margin="10dp" from top LinearLayout it looked fine now in Android's Studio emulator also! So in case you see similar problem check margins in parent Layouts

App crashes on Emulator, but works on physical device

I have an app that I can run on a physical ZTE Majesty Pro and it works fine, and I can run it on an AVD tablet. When I tried it on a Pixel AVD and a Nexus 5X AVD, the app crashes on startup. I don't know why this is happening, does it have something to do with the screen size? This is the layout that I believe may be affecting it. I use a lot of images for the layout, so do I need to scale down my images to make it run? If that is the case, how could I scale them down? Logcat doesn't log any data when I run it on the Pixel or Nexus either.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/bottom_nav">
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity" />
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:id="#+id/new_spotting"
android:src="#drawable/plus"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#ffffff"
android:contentDescription="#string/spotting"
android:onClick="onClick"/>
<View
android:layout_width="match_parent"
android:layout_height="85dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dp"
android:background="#44ba52"/>
<View
android:layout_width="100dp"
android:layout_height="120dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:id="#+id/map_background"
android:background="#drawable/curvelines"/>
<ImageView
android:id="#+id/HomeButton"
android:layout_width="100dp"
android:layout_height="75dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:contentDescription="#string/home"
android:onClick="onClick"
android:scaleType="fitCenter"
android:src="#drawable/homebutton" />
<ImageView
android:id="#+id/MapButton"
android:layout_width="145dp"
android:layout_height="90dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:contentDescription="#string/map"
android:padding="5dp"
android:layout_marginBottom="20dp"
android:onClick="onClick"
android:scaleType="fitCenter"
android:src="#drawable/mapbutton" />
<ImageView
android:id="#+id/MenuButton"
android:onClick="onClick"
android:layout_width="100dp"
android:layout_height="75dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:src="#drawable/menubutton"
android:contentDescription="#string/menu"
android:scaleType="fitCenter"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"/>
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:id="#+id/new_spotting_page"
android:visibility="visible">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Add a New Sighting"
android:textColor="#000000"
android:fontFamily="monospace"
android:textSize="30sp"
android:gravity="center" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Type of Animal:"
android:textColor="#000000"
android:fontFamily="monospace"
android:textSize="15sp"
android:gravity="start"
android:layout_marginTop="5dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="40dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="150dp"
android:id="#+id/moose_select"
android:padding="5dp"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="#drawable/moose"
android:id="#+id/moose"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="15dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Moose"
android:textColor="#000000"
android:textSize="20sp"
android:fontFamily="monospace"
android:layout_alignLeft="#+id/moose"
android:layout_alignStart="#+id/moose"
android:layout_alignRight="#+id/moose"
android:layout_alignEnd="#+id/moose"
android:layout_alignParentBottom="true"
android:layout_margin="5dp"
android:gravity="center"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="150dp"
android:id="#+id/bear_select"
android:layout_centerHorizontal="true"
android:padding="5dp"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
android:id="#+id/bear"
android:layout_height="100dp"
android:src="#drawable/bear"
android:layout_margin="15dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bear"
android:textColor="#000000"
android:textSize="20sp"
android:fontFamily="monospace"
android:layout_alignLeft="#+id/bear"
android:layout_alignStart="#+id/bear"
android:layout_alignRight="#+id/bear"
android:layout_alignEnd="#+id/bear"
android:layout_alignParentBottom="true"
android:layout_margin="5dp"
android:gravity="center"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:id="#+id/deer_select"
android:padding="5dp"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
android:id="#+id/deer"
android:layout_height="100dp"
android:src="#drawable/deer"
android:layout_margin="15dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Deer"
android:textColor="#000000"
android:textSize="20sp"
android:fontFamily="monospace"
android:layout_alignLeft="#+id/deer"
android:layout_alignStart="#+id/deer"
android:layout_alignRight="#+id/deer"
android:layout_alignEnd="#+id/deer"
android:layout_alignParentBottom="true"
android:layout_margin="5dp"
android:gravity="center"/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="150dp"
android:id="#+id/coyote_select"
android:padding="5dp"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="#drawable/coyote"
android:id="#+id/coyote"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="15dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Coyote"
android:textColor="#000000"
android:textSize="20sp"
android:fontFamily="monospace"
android:layout_alignLeft="#+id/coyote"
android:layout_alignStart="#+id/coyote"
android:layout_alignRight="#+id/coyote"
android:layout_alignEnd="#+id/coyote"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:gravity="center"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="150dp"
android:id="#+id/lion_select"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="15dp"
android:padding="5dp"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
android:id="#+id/lion"
android:layout_height="100dp"
android:src="#drawable/lion"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Puma"
android:textColor="#000000"
android:textSize="20sp"
android:fontFamily="monospace"
android:layout_alignLeft="#+id/lion"
android:layout_alignStart="#+id/lion"
android:layout_alignRight="#+id/lion"
android:layout_alignEnd="#+id/lion"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:gravity="center"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="150dp"
android:id="#+id/fox_select"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginHorizontal="15dp"
android:padding="5dp"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
android:id="#+id/fox"
android:layout_height="100dp"
android:src="#drawable/fox"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fox"
android:textColor="#000000"
android:textSize="20sp"
android:fontFamily="monospace"
android:layout_alignLeft="#+id/fox"
android:layout_alignStart="#+id/fox"
android:layout_alignRight="#+id/fox"
android:layout_alignEnd="#+id/fox"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:gravity="center"/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp">
<Button
android:id="#+id/cancel"
android:onClick="onClick"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignTop="#+id/add"
android:layout_toRightOf="#+id/spacer"
android:layout_toEndOf="#+id/spacer"
android:text="Cancel"
android:textSize="18sp"/>
<View
android:id="#+id/spacer"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_centerHorizontal="true" />
<Button
android:id="#+id/add"
android:onClick="onClick"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="#+id/spacer"
android:layout_toStartOf="#+id/spacer"
android:text="Add to Map"
android:textSize="18sp"/>
</RelativeLayout>
</TableLayout>
Please provide the error log from Logcat.
Are you implementing and using any Google Service? If yes check if your Virtual Device has the Google API.

graph not showing in horizontalscrollview android

i am microcharts.droid.ChartView in xamarin to make a line graph, and i want it to be horizontal scroll able, but by using following code graph is not showing up.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#444444">
<refractored.controls.CircleImageView
app:civ_border_width="2dp"
app:civ_border_color="#FFFFFF"
android:layout_width="80dp"
android:layout_height="80dp"
android:id="#+id/profilepicimageview"
android:src="#drawable/profilepic"
android:scaleType="centerCrop"
android:layout_marginLeft="15dp"
android:layout_marginTop="5dp" />
<TextView
android:text="..."
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_below="#id/profilepicimageview"
android:textColor="#android:color/white"
android:id="#+id/txtHomeFullName"
android:layout_marginLeft="5dp" />
<TextView
android:text="12500"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/HomeUserTextViewScore"
android:textColor="#android:color/white"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="30dp"
android:layout_marginRight="60dp" />
<ImageView
android:src="#drawable/star"
android:layout_width="30dp"
android:layout_height="30dp"
android:id="#+id/imageViewStarHome"
android:scaleType="centerCrop"
android:layout_marginTop="30dp"
android:layout_toLeftOf="#id/HomeUserTextViewScore" />
<ProgressBar
style="#android:style/Widget.ProgressBar.Horizontal"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:maxHeight="15dp"
android:minHeight="15dp"
android:layout_below="#id/imageViewStarHome"
android:id="#+id/progressBarHome"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
android:layout_marginRight="30dp" />
<HorizontalScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="80dp">
<TextView
android:text="WELCOME TO PERKIT"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:background="#302f2f"
android:textColor="#android:color/white"
android:id="#+id/textViewWelcomeToPerkit" />
<microcharts.droid.ChartView
android:id="#+id/chartView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:id="#+id/linebtn"
android:layout_height="55dp"
android:layout_width="match_parent"
android:background="#444444"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal">
<ImageButton
android:src="#drawable/rewardDisabled"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginRight="16dp"
android:background="#drawable/roundedbutton"
android:id="#+id/btnHomeReward" />
<ImageButton
android:src="#drawable/leaderDisabled"
android:id="#+id/btnHomeTournaments"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginRight="8dp"
android:background="#drawable/roundedbutton" />
<ImageButton
android:src="#drawable/settingsDisabled"
android:id="#+id/btnHomeSettings"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginLeft="8dp"
android:background="#drawable/roundedbutton" />
<ImageButton
android:src="#drawable/homeEnabled"
android:id="#+id/btnHomeHome"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginLeft="16dp"
android:background="#drawable/roundedbuttonEnabled" />
</LinearLayout>
<TextView
android:text="Loading.."
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#android:color/white"
android:id="#+id/txtLoadingTextHome"
android:gravity="center"
android:background="#8889" />
</RelativeLayout>
i want to make the graph horizontal scroll able. to show on layout.
thanks. how can i achieve it in android.i am developing the app in xamarin android. is there any other good library to achieve this?
Try to specify a fixed layout_width to the chartView

Background ImageView is not Shown in API level 16 though working good in API 19

I am not able to find out the exact issue that why the image(background) is not visible in API level 16 but it is showing good in API level 19. I have worked simply as i have done previously but , this time the background is not shown(of WaterMark in ImageView).
I am not able to find out what is exact issue . So i need help.I have done every thing as suggested in the stack Android device is not showing the background image but it is not going good in my case.
xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:id="#+id/scrollLogin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/rlGetInTouch"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#304EA2">
<RelativeLayout
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/header_bg2">
<ImageView
android:id="#+id/brand"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="#drawable/nbl_logo4" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#304EA2">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginBottom="35dp"
android:layout_marginTop="-60dp"
android:color="#android:color/transparent"
android:src="#drawable/logowatermark" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/edit_text_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingLeft="35dp"
android:paddingRight="35dp">
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:text=" Please login to proceed"
android:textColor="#color/white"
android:textSize="12sp"
android:textStyle="normal" />
<******.CustomFontEditText
android:id="#+id/etUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="#drawable/edit_text_border"
android:drawablePadding="8dp"
android:gravity="center"
android:hint="Mobile Number"
android:inputType="number"
android:maxLength="#integer/mobile_length"
android:padding="13dp"
android:textCursorDrawable="#drawable/color_cursor"
android:textSize="12dp"
android:textStyle="bold" />
<******.CustomFontEditText
android:id="#+id/etPassword"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp"
android:layout_toLeftOf="#+id/passwordVisibilityBtn"
android:background="#drawable/edit_text_border"
android:drawablePadding="8dp"
android:gravity="center"
android:hint="Password"
android:inputType="textPassword"
android:maxLength="#integer/password_length"
android:padding="13dp"
android:textCursorDrawable="#drawable/color_cursor"
android:textSize="12dp"
android:textStyle="bold" />
<******.CustomFontCheckBox
android:id="#+id/chkSaveUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:button="#drawable/custom_checkbox"
android:drawablePadding="5dp"
android:gravity="center"
android:text=" Remember Mobile No."
android:textColor="#color/white"
android:textSize="12sp"
android:textStyle="normal" />
<LinearLayout
android:id="#+id/loginLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#drawable/login_button_shadow"
android:orientation="vertical">
<******.CustomFontLoginTextView
android:id="#+id/btnLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/login_button_new1"
android:clickable="true"
android:gravity="center"
android:padding="13dp"
android:text="Login"
android:textAllCaps="true"
android:textColor="#color/white"
android:textSize="14sp" />
<******.CustomFontLoginTextView
android:id="#+id/action_sms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="#drawable/login_button_new1"
android:clickable="true"
android:gravity="center"
android:paddingBottom="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:text="Switch To SMS"
android:textColor="#color/white"
android:textSize="12sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<******.CustomFontLoginTextView
android:id="#+id/resetDeviceId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:alpha="0.7"
android:drawableLeft="#drawable/icon_reset_20"
android:drawablePadding="3dp"
android:gravity="center"
android:text="#string/reset_device_id_text"
android:textColor="#color/white"
android:textSize="12sp" />
<******.CustomFontLoginTextView
android:id="#+id/action_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:alpha="0.7"
android:drawableLeft="#drawable/icon_info_20"
android:drawablePadding="3dp"
android:gravity="center"
android:text="#string/info"
android:textColor="#color/white"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<!-- Promo -->
<LinearLayout
android:id="#+id/llPromotions"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/promo_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/llBranches"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rlLogin"
android:layout_gravity="center"
android:background="#304EA2"
android:gravity="center"
android:orientation="horizontal"
android:padding="15dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:clickable="true"
android:onClick="showATMs"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:padding="2dp"
android:src="#drawable/icon_atm_50_6" />
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:text="ATM"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="3dp"
android:text="Locate nearest Atm Machines"
android:textColor="#FFFFFF"
android:textSize="8sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:clickable="true"
android:onClick="showBranches"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="2dp"
android:src="#drawable/ic_branches_50_6" />
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="8dp"
android:text="BRANCHES"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="3dp"
android:text="Locate nearest bank branches"
android:textColor="#FFFFFF"
android:textSize="8sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:clickable="true"
android:onClick="showRates"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="2dp"
android:src="#drawable/ic_rates_50_6" />
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:text="RATES"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="3dp"
android:text="Foreign exchange and stock rates"
android:textColor="#FFFFFF"
android:textSize="8sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/rlProducts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<******.CustomFontLoginTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="Products"
android:textAllCaps="true"
android:textColor="#color/gray"
android:textSize="14sp" />
<!--Product Container-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!--Product 1-->
<LinearLayout
android:id="#+id/product_content1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="7.5dp"
android:layout_weight="1"
android:orientation="vertical" />
<!--Product 2-->
<LinearLayout
android:id="#+id/product_content2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="7.5dp"
android:layout_marginRight="15dp"
android:layout_weight="1"
android:gravity="end"
android:orientation="vertical" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/rlGetInTouch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#304EA2"
android:orientation="horizontal">
<CustomFontLoginTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/btnCall"
android:paddingLeft="15dp"
android:singleLine="true"
android:text="Get in touch with us"
android:textColor="#color/white"
android:textSize="16sp"
android:textStyle="normal" />
<!--app:maxTextSize="14sp"
app:minTextSize="#dimen/minFontSize"-->
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/btnMap"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="10dp"
android:onClick="showLocation"
android:src="#drawable/ic_action_location_24_4" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/btnEmail"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/btnMap"
android:layout_toStartOf="#+id/btnMap"
android:onClick="openEmail"
android:src="#drawable/ic_action_mail_24_4" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/btnCall"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/btnEmail"
android:layout_toStartOf="#+id/btnEmail"
android:onClick="openCall"
android:src="#drawable/ic_action_call_24_4" />
</RelativeLayout>
</RelativeLayout>
The Image background of watermark is not shown. I have done nothing
new ,same as previous but dont' know that is the exact issue.
Please reduce image size to visible in the lower level device.
I Just Removed marginTop and it worked fine in API level 16
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginBottom="35dp"
android:src="#drawable/logowatermark" />
I don't understand that why it worked when i remove the -ve marginTop
in above? .I got solution but don't understand what exactly happened
in adding -ve marginTop and with removing -ve marginTop.

Android Image doesn't display on some devices

Android noob here.
I am using an image in an image view.
Image Specs: 750x500 PNG 835.36kb
It displays correctly on all device emulators and on the real device during debug. However after release it doesn't appear to show on some devices.
It's image with src 'main22' which is causing the issues.
Any help resolving this would be much appreciated!
I am using the following xml code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.mattblack.fibreapp.MainActivity"
android:background="#000000">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView"
android:src="#drawable/main22"
android:layout_gravity="center_horizontal"
android:layout_above="#+id/frameLayout"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:adjustViewBounds="false"
android:cropToPadding="false"
android:layout_below="#+id/frameLayout6"
android:nestedScrollingEnabled="false"
android:scaleType="fitXY" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="90dp"
android:background="#ffffff"
android:id="#+id/frameLayout"
android:layout_gravity="center_horizontal"
android:layout_above="#+id/frameLayout2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="false">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="INACTIVE"
android:id="#+id/qjumpButton"
android:layout_gravity="center"
android:textColor="#000000"
android:background="#ffffff"
android:textSize="30sp"
android:typeface="normal"
android:onClick="clickFunction"
android:enabled="true"
android:clickable="true"
style="?android:attr/borderlessButtonStyle"
android:textStyle="normal"
android:layout_marginBottom="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Queue Jump"
android:id="#+id/textView2"
android:layout_gravity="center_horizontal|bottom"
android:textSize="20sp"
android:textColor="#e4c353"
android:layout_marginBottom="15dp" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:id="#+id/frameLayout2"
android:layout_gravity="center_horizontal"
android:layout_above="#+id/frameLayout3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<ImageView
android:layout_width="100dp"
android:layout_height="80dp"
android:id="#+id/shakeImage"
android:layout_gravity="center"
android:src="#drawable/shake"
android:visibility="visible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="WINNER!"
android:id="#+id/winnerText"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"
android:textSize="30sp"
android:visibility="invisible"
android:layout_marginTop="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1 x The Prize"
android:id="#+id/prizeText"
android:layout_gravity="center"
android:textColor="#ffffff"
android:textSize="20sp"
android:visibility="invisible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show at the Bar to Claim before we close."
android:id="#+id/claimText"
android:layout_gravity="center_horizontal|bottom"
android:textColor="#ffffff"
android:visibility="invisible"
android:layout_marginBottom="15dp"
android:textSize="12dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NO WIN"
android:id="#+id/nowinText"
android:layout_gravity="center_horizontal|top"
android:textColor="#ffffff"
android:textSize="40sp"
android:layout_marginTop="30dp"
android:visibility="invisible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Try Again Tomorrow."
android:id="#+id/tryagainText"
android:layout_gravity="center_horizontal|bottom"
android:textColor="#ffffff"
android:textSize="12sp"
android:layout_marginBottom="20dp"
android:visibility="invisible" />
<Button
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/down"
android:layout_gravity="center"
android:alpha="0.1"
android:enabled="true"
android:clickable="true"
android:visibility="invisible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Shake Again Tomorrow."
android:id="#+id/shakeTomorrowText"
android:layout_gravity="center"
android:textSize="15sp"
android:textColor="#ffffff"
android:visibility="invisible" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#ffffff"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="#+id/frameLayout3">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HOME"
android:id="#+id/button"
android:layout_gravity="left|center_vertical"
android:background="#ffffff" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CODE"
android:id="#+id/button9"
android:layout_gravity="right|center_vertical"
android:background="#ffffff"
android:onClick="profilePageClick" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentBottom="false"
android:layout_centerHorizontal="true"
android:layout_alignParentStart="false"
android:layout_alignParentTop="true"
android:background="#ffffff"
android:id="#+id/frameLayout6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FIBRE"
android:id="#+id/textView"
android:layout_gravity="center"
android:textSize="25sp"
android:textColor="#d9bc00" />
</FrameLayout>
</RelativeLayout>
I was facing the same issue. In my case the image was very large in size and that was the reason image was not showing on some device. Just reduce the image size and it will work.

Categories

Resources