之前写过一篇Intent的博客,主要说了一下隐式意图。 传送门:《Android -- Intent》Intent对象构成 Component name、Action、Data、Category、Extras、FlagsComponent name Component name即组件名称,是要处理这...
分类:
移动开发 时间:
2014-08-26 00:23:05
阅读次数:
267
1.无参数Activity跳转 Intent it = new Intent(Activity.Main.this, Activity2.class); startActivity(it); 2.向下一个Activity传递数据(使用Bundle和Intent.putExtras) Inte...
分类:
其他好文 时间:
2014-08-25 20:43:04
阅读次数:
262
1.Intent激活 新的activity激活组件,附带数据设置要激活的组件 显式Intent1>intent.setClass(this,OtherActivity.class)2>intent.setClassName(this,"packagename.OtherActivity")3>int...
分类:
移动开发 时间:
2014-08-25 18:58:44
阅读次数:
147
示例代码:public void start() throws Exception { String separator = System.getProperty("file.separator"); String classpath = System.getProperty("java.class...
分类:
编程语言 时间:
2014-08-25 16:47:24
阅读次数:
215
在接收消息广播的onReceive里,跳转到你要显示的界面。如:
Intent intent = new Intent(arg0,MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
arg0.startActivity(intent);
在该activity的onCreate()方法里:
...
分类:
移动开发 时间:
2014-08-25 13:26:54
阅读次数:
297
出现这个错误是在我在使用动态广播监听短信是否发送成功,正如错误提示所说,我忘了在我的代码中取消注册广播,因为这是动态广播,所以我必须在不需要的时候将这个广播手动注销,否则就会发生如题所示的异常,这个异常的解决办法很简单,就是在动态广播的onReceiver()方法中注销广播,如下代码所示:
public void onReceive(Context context, Intent i...
分类:
其他好文 时间:
2014-08-25 10:03:44
阅读次数:
220
例如:
系统音乐
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
ComponentName cn = new ComponentName("com.an...
分类:
移动开发 时间:
2014-08-24 23:55:03
阅读次数:
258
Android中的Service有两种启动方式1,startSverice2,bindService这两种启动Service的方式略有不同。首先看startServiceIntent startIntent = new Intent(MainActivity.this,MyService.class...
分类:
移动开发 时间:
2014-08-24 23:41:23
阅读次数:
268
开头 Intent作为联系各Activity之间的纽带,其作用并不仅仅只限于简单的数据传递。通过其自带的属性,其实可以方便的完成很多较为复杂的操作。例如直接调用拨号功能、直接自动调用合适的程序打开不同类型的文件等等。 诸如此类,都可以通过设置Intent属性来完成。Intent主要有以下四个重要属性,它们分别为:Action:Action属性的值为一个字符串,它代表了系统中已经定义了...
分类:
其他好文 时间:
2014-08-24 16:45:23
阅读次数:
431
//以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent。
002
003 //一、打开一个网页,类别是Intent.ACTION_VIEW
004
005 Uri uri = Uri.parse(“http://blog.3gstdy.com/”);
006
007 Intent intent = new Inten...
分类:
移动开发 时间:
2014-08-24 01:53:01
阅读次数:
388