android_不显示界面的activity调用
2014-10-16 21:28
309 查看
1.程序A调用程序B
2.程序A:
ComponentName componetName = new ComponentName(
//package
"pers.phoenix.factory",
//activity
"pers.phoenix.factory.AccountActivity");
Intent intent= new Intent();
Bundle bundle = new Bundle();
bundle.putString("action", "test");
intent.putExtras(bundle);
intent.setComponent(componetName);
startActivity(intent);
3.程序B的AndroidManifest.xml:
<activity
android:name="pers.phoenix.factory.AccountActivity"
android:theme="@android:style/Theme.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
4.程序B的代码:
public class AccountActivity extends Activity{
private static final String TAG = AccountActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
Intent intent= getIntent();
String value=intent.getStringExtra("action");
Log.i(TAG, "parameter--------> " + value); //余下省略......
2.程序A:
ComponentName componetName = new ComponentName(
//package
"pers.phoenix.factory",
//activity
"pers.phoenix.factory.AccountActivity");
Intent intent= new Intent();
Bundle bundle = new Bundle();
bundle.putString("action", "test");
intent.putExtras(bundle);
intent.setComponent(componetName);
startActivity(intent);
3.程序B的AndroidManifest.xml:
<activity
android:name="pers.phoenix.factory.AccountActivity"
android:theme="@android:style/Theme.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
4.程序B的代码:
public class AccountActivity extends Activity{
private static final String TAG = AccountActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
Intent intent= getIntent();
String value=intent.getStringExtra("action");
Log.i(TAG, "parameter--------> " + value); //余下省略......
相关文章推荐
- Android -- 两个activity界面的切换, 显示Intent 和 隐式Intent,putExtra传递数据
- Android 登录界面调用输入法时让界面自动上移,使输入法不会遮挡到主界面(Activity)
- android 联系人中,在超大字体下,加入至联系人界面(ConfirmAddDetailActivity)上有字体显示不全的问题
- App调用系统Camera拍照或者从Gallery选取图片,返回时先显示手机Launcher或者前一个界面,再跳转到当前activity
- Android用shareUserID实现多个Activity显示在同一界面
- android 调用系统相册选取照片或者打开相机拍照获取图片,返回时为什么会回到home界面或者到前一个界面,然后才会跳转到当前activity
- android 利用一条 adb命令行 秒速找到当前显示界面的Activity类名
- android调用系统相机拍照保存照片并显示在当前界面
- unity在android显示界面(UnityPlayerActivity)不重复加载且app退出杀掉所有界面的两种方法
- android 联系人中,在超大字体下,添加至联系人界面(ConfirmAddDetailActivity)上有字体显示不全的问题
- Android-调用本地方法计算int数值相加结果显示在界面上/NDK-JNI开发实例(三)
- Android中Activity启动模式详解,可以控制程序按home键后进来还会调用一个自己不喜欢的界面
- Android之Activity界面跳转--生命周期方法调用顺序
- Android用shareUserID实现多个Activity显示在同一界面
- Android应用程序中的多个Activity的显示创建和调用
- Android-Activity之间显示和隐式跳转-Date 数据跳转-调用系统的的组件
- Android-java调用本地方法返回字符串显示在界面上/NDK-JNI开发实例(二)
- Android 应用点击图标到Activity界面显示的过程分析
- Android调用系统相册和相机选择图片显示在界面
- Android与Unity交互调用mUnityPlayer.quit()方法退出返回上一个Activity界面