Intent intent;
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(file, "application/pdf");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
// No application to view, ask to download one
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("No Application Found");
builder.setMessage("Download one from Android Market?");
builder.setPositiveButton("Yes, Please",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent etIntent = new Intent(Intent.ACTION_VIEW);
etIntent
.setData(Uri
.parse("et://details?id=com.adobe.reader"));
startActivity(etIntent);
}
});
builder.setNegativeButton("No, Thanks", null);
builder.create().show();
}
}
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(file, "application/pdf");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
// No application to view, ask to download one
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("No Application Found");
builder.setMessage("Download one from Android Market?");
builder.setPositiveButton("Yes, Please",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent etIntent = new Intent(Intent.ACTION_VIEW);
etIntent
.setData(Uri
.parse("et://details?id=com.adobe.reader"));
startActivity(etIntent);
}
});
builder.setNegativeButton("No, Thanks", null);
builder.create().show();
}
}
请管理员和产品考虑下这样的流程:
1. 4月25号注册了一个帐号A:csdn_test,并发了一些贴子
2. 4月26号用自己的weibo帐号B:weibo_test登录,并发了一个一些帖子
3. 4月27号,用户想把A,B帐号打通。问题来了。1.登录B:weibo_test 想绑定A
选择绑定帐号,sorry,只有解除绑定的选项!
选择解除绑定,sorry,还得绑定邮箱!
设置老邮箱,oh,soory!设置新邮箱,oh,sorry!(其实我早就绑定过邮箱了)
2.登录A:csdn_test 想绑定B
点击绑定:oh,no!又返回帐号B了!