Button but1 = (Button) findViewById(R.id.button);
but1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// it was the 1st button
Intent LaunchIntent = null;
try{
LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.google.android.apps.unveil");
startActivity(LaunchIntent);
}
catch (NullPointerException e){
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.google.android.apps.unveil"));
startActivity(intent);
}
}
});
Теги:
android, goggles, google