最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

android+饭否+开源,fanfou(饭否) android客户端 代码学习一

互联网 admin 25浏览 0评论

android+饭否+开源,fanfou(饭否) android客户端 代码学习一

fanfou(饭否) android客户端 代码学习1

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 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...

android+饭否+开源,fanfou(饭否) android客户端 代码学习一

fanfou(饭否) android客户端 代码学习1

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 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...

发布评论

评论列表 (0)

  1. 暂无评论