Chinaunix首页 | 论坛 | 博客
  • 博客访问: 134477
  • 博文数量: 38
  • 博客积分: 1605
  • 博客等级: 上尉
  • 技术积分: 370
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-12 14:59
文章分类

全部博文(38)

文章存档

2013年(3)

2012年(8)

2011年(28)

分类: 嵌入式

2011-06-20 09:33:08

  1. package com.test;

  2. import java.net.URISyntaxException;

  3. import android.app.Activity;
  4. import android.content.ComponentName;
  5. import android.content.Intent;
  6. import android.os.Bundle;
  7. import android.util.Log;
  8. import android.view.View;
  9. import android.widget.Button;

  10. public class TestActivity1 extends Activity {
  11.     /** Called when the activity is first created. */
  12.     @Override
  13.     public void onCreate(Bundle savedInstanceState) {
  14.         super.onCreate(savedInstanceState);
  15.         setContentView(R.layout.main);
  16.         
  17.         Button btn = (Button)this.findViewById(R.id.button1);
  18.         btn.setOnClickListener(new View.OnClickListener()
  19.         {
  20.             public void onClick(View v)
  21.             {
  22.                 //com.test.ApplicationManager
  23.                 try {
  24.                     Intent intent = Intent.parseUri("intent:#Intent;action=android.intent.action.MAIN;component=com.test.ApplicationManager/.MainActivity;end", 0);
  25.                     intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  26.                     startActivity(intent);
  27.                 } catch (URISyntaxException e) {
  28.                     // TODO Auto-generated catch block
  29.                     e.printStackTrace();
  30.                 }
  31.             }
  32.         });
  33.     }
  34. }
阅读(2319) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~