android - Imageview not showing on Lollipop and Marshmallow -
i have simple activity , xml shows .png file fills whole activity. have tested in kitkat , ice cream. working. not working on lollipop , marshmallow. i've check other answers not 1 looking for. activity simple one.
help activity
package com.pointwest.timetrackermobilelog.activities; import android.content.intent; import android.os.bundle; import android.support.v7.app.appcompatactivity; import com.pointwest.timetrackermobilelog.r; public class helpactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_help_material); getsupportactionbar().setdisplayhomeasupenabled(true); getsupportactionbar().sethomebuttonenabled(true); } @override public void onbackpressed() { super.onbackpressed(); intent mainintent = new intent(this, mainactivity.class); startactivity(mainintent); } }
activity_help_material.xml
<linearlayout 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:orientation="vertical" android:gravity="fill" android:background="@color/blue_main" tools:context="com.pointwest.timetrackermobilelog.activities.loginactivity"> <imageview android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaletype="fitxy" android:src="@drawable/help"/> </linearlayout>
those 2 files.
androidmanifest.xml this
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pointwest.timetrackermobilelog" > <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="android.permission.use_credentials" /> <!-- permission required use alarm manager --> <uses-permission android:name="com.android.alarm.permission.set_alarm"/> <application android:name=".webservices.applicationclass" android:allowbackup="true" android:icon="@mipmap/tt_app_icon" android:label="@string/app_name" android:theme="@style/apptheme" > <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <meta-data android:name="com.google.android.gms.analytics.globalconfigresource" android:value="@xml/pointwest_tracker" /> <activity android:name=".activities.loginactivity" android:screenorientation="portrait" android:label="@string/app_name" > <meta-data android:name="android.support.parent_activity" android:value=".activities.openingactivity" /> </activity> <activity android:name=".activities.mainactivity" android:label="@string/available_title" android:configchanges="orientation|keyboardhidden" android:screenorientation="portrait" android:parentactivityname=".activities.loginactivity" > <meta-data android:name="android.support.parent_activity" android:value=".activities.loginactivity" /> </activity> <activity android:name=".activities.openingactivity" android:screenorientation="portrait" android:configchanges="orientation|keyboardhidden" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name=".activities.demoactivity" android:screenorientation="portrait" android:configchanges="orientation|keyboardhidden" android:label="@string/title_activity_demo" > </activity> <activity android:name=".activities.chooseactivity" android:label="@string/title_activity_choose" > </activity> <activity android:name=".activities.reminderactivity" android:screenorientation="portrait" android:label="@string/title_reminder_activity"> <meta-data android:name="android.support.parent_activity" android:value=".activities.mainactivity" /> </activity> <activity android:name=".activities.helpactivity" android:screenorientation="portrait" android:label="@string/title_help"> <meta-data android:name="android.support.parent_activity" android:value=".activities.mainactivity" /> </activity> <service android:name="com.pointwest.timetrackermobilelog.businessservices.connectivityoutsideappservice" android:exported="false"/> <!--register alarm receiver --> <receiver android:name="com.pointwest.timetrackermobilelog.utilities.notificationreceiver" android:enabled="true" /> <receiver android:name="com.pointwest.timetrackermobilelog.utilities.connectivityoutsideappreceiver" android:enabled="true" android:process=":remote"> <intent-filter android:priority="1000" > <action android:name="android.net.conn.connectivity_change"/> </intent-filter> </receiver> </application>
finally, build.gradle
apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.pointwest.timetrackermobilelog" vectordrawables.usesupportlibrary = true minsdkversion 15 targetsdkversion 23 versioncode 32 versionname "1.0" multidexenabled true } repositories { maven { url "https://jitpack.io" } jcenter() } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } ext { supportlibversion = '23.2' // variable can referenced keep support libs consistent } // dexoptions { // predexlibraries = false // javamaxheapsize "4g" // use gig increments depending on needs // incremental true // } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.2.+' compile 'com.android.support:design:23.2.+' compile 'com.android.support:cardview-v7:23.2.+' compile 'com.android.support:recyclerview-v7:23.2.+' compile "com.android.support:support-v4:23.2.+" compile 'com.squareup.retrofit:retrofit:1.9.0' compile 'com.jpardogo.materialtabstrip:library:1.1.0' compile 'com.google.android.gms:play-services:8.4.0' compile 'io.realm:realm-android:0.82.0' compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0' compile 'com.squareup.okhttp:okhttp:2.0.0' compile 'com.android.support:multidex:1.0.0' // compile 'com.github.navasmdc:materialdesign:1.5@aar' compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.3' compile 'me.zhanghai.android.materialprogressbar:library:1.1.5' compile 'com.code-troopers.betterpickers:library:2.5.3' }
here's project structure
move drawable drawable
folder drawable-nodpi
folder
Comments
Post a Comment