我在Play商店(我的第一个应用程序)上有一个应用程序。我的第一个版本没有崩溃。但是当我发布我的第二个版本时,它只在三星设备上崩溃。我在我的无品牌果冻豆设备和模拟器上进行了测试,它运行良好。我没有三星设备。我现在能做什么?
我认为它会破坏启动器活动。我的启动器活动是主要的。这是一个闪屏。代码和错误如下。
App Name : Rebel Poet Nazrul
package name : com.xplosive.rebelpoetnazrul
从Play商店堆栈跟踪复制
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xplosive.rebelpoetnazrul/com.xplosive.rebelpoetnazrul.Main}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4517)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.xplosive.rebelpoetnazrul.Main.onCreate(Main.java:56)
at android.app.Activity.performCreate(Activity.java:4470)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
at 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();
} finally {
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 is 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>
崩溃设备列表
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)