當前位置: 首頁>>代碼示例>>Java>>正文


Java Context.startActivity方法代碼示例

本文整理匯總了Java中android.content.Context.startActivity方法的典型用法代碼示例。如果您正苦於以下問題:Java Context.startActivity方法的具體用法?Java Context.startActivity怎麽用?Java Context.startActivity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.Context的用法示例。


在下文中一共展示了Context.startActivity方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import android.content.Context; //導入方法依賴的package包/類
public static ActivityScriptExecution execute(Context context, ScriptEngineManager manager, ScriptExecutionTask task) {
    ActivityScriptExecution execution = new ActivityScriptExecution(manager, task);
    Intent i = new Intent(context, ScriptExecuteActivity.class)
            .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    IntentExtras.newExtras()
            .put(EXTRA_EXECUTION, execution)
            .putInIntent(i);
    context.startActivity(i);
    return execution;
}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:11,代碼來源:ScriptExecuteActivity.java

示例2: launch

import android.content.Context; //導入方法依賴的package包/類
public static void launch(Context context) {
    Intent intent = new Intent();
    intent.setClass(context, XListViewActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);

    context.startActivity(intent);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:XListViewActivity.java

示例3: actionForward

import android.content.Context; //導入方法依賴的package包/類
/**
 * Compose a new message as a forward of the given message.
 */
public static void actionForward(Context context, MessageReference messageReference, Parcelable decryptionResult) {
    Intent i = new Intent(context, MessageCompose.class);
    i.putExtra(MessageCompose.EXTRA_MESSAGE_REFERENCE, messageReference.toIdentityString());
    i.putExtra(MessageCompose.EXTRA_MESSAGE_DECRYPTION_RESULT, decryptionResult);
    i.setAction(MessageCompose.ACTION_FORWARD);
    context.startActivity(i);
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:11,代碼來源:MessageActions.java

示例4: callPhone

import android.content.Context; //導入方法依賴的package包/類
/**
 * 撥打電話
 *
 * @param con
 * @param phonenum
 */
public static void callPhone(Context con, String phonenum) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:" + phonenum));
    con.startActivity(intent);
}
 
開發者ID:quickhybrid,項目名稱:quickhybrid-android,代碼行數:13,代碼來源:DeviceUtil.java

示例5: installAPK

import android.content.Context; //導入方法依賴的package包/類
public static void installAPK(Context context, File file) {
    if (file == null || !file.exists())
        return;
    Intent intent = new Intent();
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
    context.startActivity(intent);
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:10,代碼來源:TDevice.java

示例6: storeCertificate

import android.content.Context; //導入方法依賴的package包/類
/**
  * Adds a cryptographic file (User certificate, a CA certificate or
  * PKCS#12 keychain) through the system's CertInstaller activity.
  *
  * @param context current application context.
  * @param certType cryptographic file type. E.g. CertificateMimeType.X509_USER_CERT
  * @param data certificate/keychain data bytes.
  * @return true on success, false on failure.
  *
  * Note that failure only indicates that the function couldn't launch the
  * CertInstaller activity, not that the certificate/keychain was properly
  * installed to the keystore.
  */
@CalledByNative
public static boolean storeCertificate(Context context, int certType, byte[] data) {
    try {
        Intent intent = KeyChain.createInstallIntent();
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        switch (certType) {
            case CertificateMimeType.X509_USER_CERT:
            case CertificateMimeType.X509_CA_CERT:
                intent.putExtra(KeyChain.EXTRA_CERTIFICATE, data);
                break;

            case CertificateMimeType.PKCS12_ARCHIVE:
                intent.putExtra(KeyChain.EXTRA_PKCS12, data);
                break;

            default:
                Log.w(TAG, "invalid certificate type: " + certType);
                return false;
        }
        context.startActivity(intent);
        return true;
    } catch (ActivityNotFoundException e) {
        Log.w(TAG, "could not store crypto file: " + e);
    }
    return false;
}
 
開發者ID:lizhangqu,項目名稱:chromium-net-for-android,代碼行數:41,代碼來源:AndroidNetworkLibrary.java

示例7: launch

import android.content.Context; //導入方法依賴的package包/類
public static void launch(Context context, String input, String phone) {
    Intent intent = new Intent(context, SetPassActivity.class);
    intent.putExtra(INPUT, input);
    intent.putExtra(PHONE, phone);
    context.startActivity(intent);
    ((Activity) context).overridePendingTransition(R.anim.fade_entry, R.anim.hold);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:SetPassActivity.java

示例8: openDefaultSettings

import android.content.Context; //導入方法依賴的package包/類
public static void openDefaultSettings(Context context) {
    Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);
    settingsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(settingsIntent);
}
 
開發者ID:Existentio,項目名稱:OddLauncher,代碼行數:6,代碼來源:Utils.java

示例9: start

import android.content.Context; //導入方法依賴的package包/類
public static void start(Context context) {
    Intent intent = new Intent(context, CameraActivity.class);
    context.startActivity(intent);
}
 
開發者ID:FreeSunny,項目名稱:Amazing,代碼行數:5,代碼來源:CameraActivity.java

示例10: start

import android.content.Context; //導入方法依賴的package包/類
public static void start(Context context) {
    Intent intent = new Intent(context, SettingsActivity.class);
    context.startActivity(intent);
}
 
開發者ID:mobilemaster128,項目名稱:quickblox-android,代碼行數:5,代碼來源:SettingsActivity.java

示例11: start

import android.content.Context; //導入方法依賴的package包/類
public static void start(Context context) {
    Intent starter = new Intent(context, SpanActivity.class);
    context.startActivity(starter);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:SpanActivity.java

示例12: openDail

import android.content.Context; //導入方法依賴的package包/類
public static void openDail(Context context) {
    Intent intent = new Intent(Intent.ACTION_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}
 
開發者ID:FallenCrood,項目名稱:Review-,代碼行數:6,代碼來源:TDevice.java

示例13: show

import android.content.Context; //導入方法依賴的package包/類
public static void show(Context context, User info) {
    Intent intent = new Intent(context, UserDataActivity.class);
    intent.putExtra("user_info", info);
    context.startActivity(intent);
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:6,代碼來源:UserDataActivity.java

示例14: start

import android.content.Context; //導入方法依賴的package包/類
public static void start(Context context) {
    Intent intent = new Intent(context, AboutActivity.class);
    context.startActivity(intent);
}
 
開發者ID:BANKEX,項目名稱:smart-asset-iot-android-demo,代碼行數:5,代碼來源:AboutActivity.java

示例15: startActivity

import android.content.Context; //導入方法依賴的package包/類
public static void startActivity(Context context, String query) {
    context.startActivity(new Intent(context, SearchActivity.class)
            .putExtra(INTENT_QUERY, query));
}
 
開發者ID:ynztlxdeai,項目名稱:TextReader,代碼行數:5,代碼來源:SearchActivity.java


注:本文中的android.content.Context.startActivity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。