这就是我现在所拥有的。它正在检查是否安装了 GoLauncher,如果是,它会将其带到 go 启动器主屏幕。如果未安装,则需要用户到市场才能安装。
我需要的是,如果它已经安装,我需要弹出一个警告框,向用户展示如何安装主题。用户点击 OK 后,它应该转到 GoLaunhcer 主屏幕
gosetting = (ImageButton) findViewById(R.id.gosetting);
gosetting.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.gau.go.launcherex","com.jiubang.ggheart.apps.desks.diy.GoLauncher"));
startActivity(intent);
}
catch (ActivityNotFoundException e) {
AlertDialog.Builder alert = new AlertDialog.Builder(HelperActivity.this);
alert.setTitle("GO Not Found");
alert.setMessage("Do you want to vist the GO Launcher Android Market page?");
alert.setIcon(R.drawable.go_icon2);
alert.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
final Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse("market://details?id=com.gau.go.launcherex"));
startActivity(intent);
}
});
alert.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
return;
}
});
alert.show();
} catch (Exception go) {
go.printStackTrace();
}
}
});
添加了您更新的代码,现在收到此错误..!1