当前位置: 首页>>代码示例>>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;未经允许,请勿转载。