LoginActivity.class类



Intent intent = getIntent().getParcelableExtra(Intent.EXTRA_INTENT); String action = intent.getAction(); if (intent.getAction() == null || !Intent.ACTION_SEND.equals(action)) {      intent = new Intent(this, TwitterActivity.class); } 

getIntent().getParcelableExtra(String activityname).. 从intent中检索继承的数据

Intent.EXTRA_INTENT intent里面传递的类名

// 发送消息给widget Intent reflogin = new Intent(this.getBaseContext(), FanfouWidget.class);reflogin.setActio("android.appwidget.action.APPWIDGET_UPDATE"); PendingIntent l = PendingIntent.getBroadcast(this.getBaseContext(), 0, reflogin, PendingIntent.FLAG_UPDATE_CURRENT); try {      l.send(); } catch... 

Intent和PendingIntent的区别

ApplicationContext 和Context的区别

从线程的角度考虑,更多的用applicationContext,但是在用到spinner时候出现uncaught exception

LayoutInflater layoutInflater = LayoutInflater.from(this.getBaseContext());// beneath param will brought uncaught problem// LayoutInflater layoutInflater = LayoutInflater.from(this.getApplicationContext()); View view = ContactViewer.mLayoutInflater.inflate(R.layout.aViewContainingASpinner, theParentView, false); Spinner spinner = (Spinner) view.findViewById(R.id.theSpinnerId); String[] myStringArray = new String[] {"sweet","love"};  // managing adapter part  // The context used here don't have any importance -- both work.  ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( this.getApplicationContext(), myStringArray, android.R.layout.simple_spinner_item);  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter);  theParentView.addView(view); 

the baseContext is required when dealing with contextMenu in your Activity...

更多相关文章

  1. Android消息机制 Handler
  2. android的布局属性中padding和margin的区别
  3. android如何在子线程中更新UI
  4. Android中一些错误
  5. Android处理线程暂停与恢复
  6. android中异步加载图片信息
  7. android 线程学习
  8. android C++ 和 jni,根据JNIEnv的FindClass获取java类,包括多线程
  9. android一个简单的线程实例

随机推荐

  1. MAC Android(安卓)Studio编写Android(安
  2. 理解Android(安卓)Java垃圾回收机制
  3. Android获取手机WiFi IP地址,MAC地址和网
  4. 超详细的Android系统50大必备秘籍分享
  5. Android(安卓)apk安装过程及Java、JNI读
  6. 第七章 ARM 反汇编基础(三)(ARM 原生程序的
  7. VirtualAPK:滴滴 Android(安卓)插件化的实
  8. uniapp解决多条socket连接冲突问题
  9. Android(安卓)Coding 利器 之 掌握小技巧
  10. Android应用开发团体赛比赛说明