Intent i = new Intent(Intent.ACTION_MAIN);
PackageManager manager = getPackageManager();
i = manager.getLaunchIntentForPackage("com.gogle.syncadapters.calendar");
startActivity(i);
Date :
2013-01-28 15:55:41
By :
ake_comsci
No. 2
Guest
Code (Android-Java)
package com.example.ttt;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.view.Menu;
public class Main extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String packageName = "com.google.syncadapters.calendar";
Intent i = new Intent(Intent.ACTION_MAIN);
PackageManager manager = getPackageManager();
i = manager.getLaunchIntentForPackage(packageName);
startActivity(i);
}
}
ขอโทษนะคะ ไม่ทราบว่าเขียนอย่างงี้รึป่าวคะ
มันขึ้น the application TTT (process com.example.ttt) has stopped unexpectedly.
Please try again.