java - My android app crashing only on Samsung devices. How can I solve it? -
i have app on play store(my first app). first version didn't crash. when released second version crashing on samsung devices. tested on no brand jelly bean device , on emulator , working perfectly. have no samsung devices. can now?
i think crashing on launcher activity. launcher activity main. splash screen. code , error provided below.
app name : rebel poet nazrul package name : com.xplosive.rebelpoetnazrul
copied play store stack traces
java.lang.runtimeexception: unable start activity componentinfo{com.xplosive.rebelpoetnazrul/com.xplosive.rebelpoetnazrul.main}: java.lang.nullpointerexception @ android.app.activitythread.performlaunchactivity(activitythread.java:1970) @ android.app.activitythread.handlelaunchactivity(activitythread.java:1995) @ android.app.activitythread.access$600(activitythread.java:128) @ android.app.activitythread$h.handlemessage(activitythread.java:1161) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4517) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:993) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:760) @ dalvik.system.nativestart.main(native method) caused by: java.lang.nullpointerexception @ com.xplosive.rebelpoetnazrul.main.oncreate(main.java:56) @ android.app.activity.performcreate(activity.java:4470) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1053) @ android.app.activitythread.performlaunchactivity(activitythread.java:1934) ... 11 more
main.java
package com.xplosive.rebelpoetnazrul; import android.app.activity; import android.content.intent; import android.graphics.typeface; import android.media.mediaplayer; import android.os.bundle; import android.widget.textview; import androidbangladesh.bengali.support.bengaliunicodestring; public class main extends activity { mediaplayer mp; textview tvbanner, tv1; typeface font; string banner, version, develop, developer; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // actionbar actionbar = getactionbar(); // actionbar.setdisplayhomeasupenabled(true); // actionbar.setbackgrounddrawable(new colordrawable(color // .parsecolor("#6699ff"))); // actionbar.setbackgrounddrawable(new colordrawable(color.green)); setcontentview(r.layout.activity_main); settitle("বিদ্রোহী কবি নজরুল"); initialize(); banner = "বিদ্রোহী কবি নজরুল"; version = "ভার্সন ২.০"; develop = "developed by"; developer = "xplo"; int apiversion = android.os.build.version.sdk_int; if (apiversion < 16) { bengaliunicodestring.getbengaliutf(main.this, banner, tvbanner); bengaliunicodestring.getbengaliutf(main.this, version, tv1); } else { tvbanner.settypeface(font); tv1.settypeface(font); tvbanner.settext(banner); tv1.settext(version); } mp = mediaplayer.create(getapplicationcontext(), r.raw.startup); //mp = mediaplayer.create(main.this, r.raw.startup); mp.start(); thread timer = new thread() { public void run() { try { sleep(2000); } catch (exception e) { e.printstacktrace(); } { intent intent = new intent(main.this, mainmenuactivity.class); startactivity(intent); } }; }; timer.start(); } private void initialize() { font = typeface.createfromasset(getassets(), "solaimanlipinormal.ttf"); tvbanner = (textview) findviewbyid(r.id.tvbanner); tv1 = (textview) findviewbyid(r.id.textview1); } @override protected void onpause() { super.onpause(); mp.release(); // mp.stop(); //this not working finish(); } }
activity_main.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:background="#66ccff" android:gravity="center" android:orientation="vertical" tools:context=".mainactivity" > <textview android:id="@+id/tvbanner" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="বিদ্রোহী কবি নজরুল" android:textcolor="@color/banner" android:textsize="35sp" /> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="ভার্সন ২.০" android:textcolor="@color/banner" android:textsize="15sp" /> <space android:layout_width="match_parent" android:layout_height="40dp" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="developed by" android:textcolor="@color/banner" android:textsize="20sp" /> <textview android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="xplo" android:textcolor="@color/banner" android:textsize="30sp" /> </linearlayout>
crash device list
galaxy s duos (kyleopen) galaxy grand duos (baffin) galaxy tab3 8.0 (lt013g) galaxy core (arubaslim) nuclear-t03 galaxy note3 (hlte) galaxy s3 mini (golden)
Comments
Post a Comment