Here are the examples of the java api android.content.Intent taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
43903 Examples
19
Source : MainActivity.java
with MIT License
from zzhoujay
with MIT License
from zzhoujay
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.gereplacedemId() == 0) {
Intent intent = new Intent(this, ViewActivity.clreplaced);
// intent.putExtra(ViewActivity.TEXT, richEditorView.getSSB());
text = richEditorView.getSSB();
startActivity(intent);
}
return super.onOptionsItemSelected(item);
}
19
Source : BaseActivity.java
with Apache License 2.0
from zyyoona7
with Apache License 2.0
from zyyoona7
protected void goTo(Clreplaced clazz) {
Intent intent = new Intent(this, clazz);
startActivity(intent);
}
19
Source : HomeFragment.java
with GNU General Public License v3.0
from zyl409214686
with GNU General Public License v3.0
from zyl409214686
/**
* 选择文件返回
*/
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mPresenter.onActivityResult(requestCode, resultCode, data);
}
19
Source : FileChooserActivity.java
with GNU General Public License v3.0
from zyl409214686
with GNU General Public License v3.0
from zyl409214686
private void clickItem(MusicInfo info) {
Intent intent = new Intent();
intent.putExtra(EXTRA_FILEPATH_CHOOSER, info.getFilepath());
intent.putExtra(EXTRA_FILE_CHOOSER, info);
setResult(RESULT_OK, intent);
finish();
}
19
Source : HomePresenter.java
with GNU General Public License v3.0
from zyl409214686
with GNU General Public License v3.0
from zyl409214686
/**
* 选择文件返回
*/
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_CANCELED) {
return;
}
// 文件选择返回结果
if (resultCode == RESULT_OK && requestCode == REQUEST_CODE) {
mSelMp3Path = data.getStringExtra(FileChooserActivity.EXTRA_FILEPATH_CHOOSER);
mSelMp3Info = data.getParcelableExtra(FileChooserActivity.EXTRA_FILE_CHOOSER);
try {
if (!TextUtils.isEmpty(mSelMp3Path)) {
mView.resetSeekBarSelValue();
mView.setPlayBtnWithStatus(false);
mView.setSeekBarEnable(true);
pause();
reset();
setDataSource(mSelMp3Path);
prepare();
mView.setSeekBarMaxValue(getDuration());
mView.checkRecordPermission(getMediaPlayer());
mView.addBarGraphRenderers();
}
} catch (IllegalArgumentException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// Auto-generated catch block
e.printStackTrace();
}
}
}
19
Source : MineFragment.java
with Apache License 2.0
from zxuu
with Apache License 2.0
from zxuu
// 拿到用户信息后回掉到mineFragment
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
User user = CniaoApplication.getInstance().getUser();
showUser(user);
}
19
Source : CartFragment.java
with Apache License 2.0
from zxuu
with Apache License 2.0
from zxuu
@OnClick(R.id.btn_order)
public void toOrder(View view) {
// httpHelper.get(Contants.API.USER_DETAIL, new SpotsCallBack<User>(getContext()) {
// @Override
// public void onSuccess(Response response, User user) {
//
// Log.d(TAG, "onSuccess: ");
// }
//
// @Override
// public void onError(Response response, int code, Exception e) {
//
// Log.d(TAG, "onError: ");
// }
// });
Intent intent = new Intent(getActivity(), CreateOrderActivity.clreplaced);
startActivity(intent, true);
}
19
Source : CreateOrderActivity.java
with Apache License 2.0
from zxuu
with Apache License 2.0
from zxuu
private void toPayResultActivity(int status) {
Intent intent = new Intent(this, PayResultActivity.clreplaced);
intent.putExtra("status", status);
startActivity(intent);
this.finish();
}
19
Source : CreateOrderActivity.java
with Apache License 2.0
from zxuu
with Apache License 2.0
from zxuu
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// 支付页面返回处理
if (requestCode == Contants.REQUEST_CODE_PAYMENT) {
if (resultCode == Activity.RESULT_OK) {
String result = data.getExtras().getString("pay_result");
if (result.equals("success"))
changeOrderStatus(1);
else if (result.equals("fail"))
changeOrderStatus(-1);
else if (result.equals("cancel"))
changeOrderStatus(-2);
else
changeOrderStatus(0);
/* 处理返回值
* "success" - payment succeed
* "fail" - payment failed
* "cancel" - user canceld
* "invalid" - payment plugin not installed
*
* 如果是银联渠道返回 invalid,调用 UPPayreplacedistEx.installUPPayPlugin(this); 安装银联安全支付控件。
*/
// String errorMsg = data.getExtras().getString("error_msg"); // 错误信息
// String extraMsg = data.getExtras().getString("extra_msg"); // 错误信息
}
}
}
19
Source : CniaoApplication.java
with Apache License 2.0
from zxuu
with Apache License 2.0
from zxuu
public void putIntent(Intent intent) {
this.intent = intent;
}
19
Source : MainActivity.java
with GNU General Public License v3.0
from zxc111
with GNU General Public License v3.0
from zxc111
public void startVpn() {
Intent intent = LocalVpnService.prepare(this);
if (intent == null) {
startVPNService();
} else {
startActivityForResult(intent, START_VPN_SERVICE_REQUEST_CODE);
}
}
19
Source : LocalVpnService.java
with GNU General Public License v3.0
from zxc111
with GNU General Public License v3.0
from zxc111
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
IsRunning = true;
return super.onStartCommand(intent, flags, startId);
}
19
Source : WXPageActivity.java
with MIT License
from zwwill
with MIT License
from zwwill
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null) {
if (result.getContents() == null) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
handleDecodeInternally(result.getContents());
}
}
super.onActivityResult(requestCode, resultCode, data);
}
19
Source : AbsWeexActivity.java
with MIT License
from zwwill
with MIT License
from zwwill
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (mInstance != null) {
mInstance.onActivityResult(requestCode, resultCode, data);
}
super.onActivityResult(requestCode, resultCode, data);
}
19
Source : UiUtils.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 跳转界面3
*
* @param
*/
public static void startActivity(Intent content) {
Message message = new Message();
message.what = START_ACTIVITY;
message.obj = content;
EventBus.getDefault().post(message, APPMANAGER_MESSAGE);
}
19
Source : UiUtils.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 跳转界面4
*
* @param
*/
public static void startActivity(Activity activity, Intent intent) {
activity.startActivity(intent);
}
19
Source : UiUtils.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 跳转界面
*
* @param activity
* @param homeActivityClreplaced
*/
public static void startActivity(Activity activity, Clreplaced homeActivityClreplaced) {
Intent intent = new Intent(activity.getApplicationContext(), homeActivityClreplaced);
activity.startActivity(intent);
}
19
Source : ArmsUtils.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 跳转界面 3
*
* @param activity
* @param homeActivityClreplaced
*/
public static void startActivity(Activity activity, Clreplaced homeActivityClreplaced) {
Intent intent = new Intent(activity.getApplicationContext(), homeActivityClreplaced);
activity.startActivity(intent);
}
19
Source : ArmsUtils.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 跳转界面 2 ,通过 {@link AppManager#startActivity(Intent)}
*
* @param
*/
public static void startActivity(Intent content) {
Message message = new Message();
message.what = START_ACTIVITY;
message.obj = content;
AppManager.post(message);
}
19
Source : ArmsUtils.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 跳转界面 4
*
* @param
*/
public static void startActivity(Activity activity, Intent intent) {
activity.startActivity(intent);
}
19
Source : DownLoadService.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
public void pause() {
if (call != null) {
call.cancel();
} else {
stopSelf();
return;
}
getNotificationManager().cancel(1);
EventBus.getDefault().post(videos.get(0).getId(), EventBusTags.CACHE_DOWNLOAD_CACNCEL);
if (videos.size() > 0) {
videos.remove(0);
if (videos.size() > 0) {
Intent intent = new Intent(this, DownLoadService.clreplaced);
intent.putExtra(DownLoadService.VIDEOS_INFO, videos.get(0));
onStart(intent, START_REDELIVER_INTENT);
} else {
// EventBus.getDefault().post(-1L, EventBusTags.CACHE_DOWNLOAD_CACNCEL);
stopSelf();
}
} else {
stopSelf();
}
}
19
Source : DownLoadService.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
/**
* 返回一个Binder对象
*/
@Override
public IBinder onBind(Intent intent) {
return null;
}
19
Source : DownLoadService.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
private Notification getNotification(String replacedle, int progress) {
Intent intent = new Intent(this, CacheActivity.clreplaced);
intent.putExtra(CacheActivity.FROM_NOTIFICATION, true);
// PendingIntent是等待的Intent,这是跳转到一个Activity组件。当用户点击通知时,会跳转到MainActivity
PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);
/**
* 几乎Android系统的每一个版本都会对通知这部分功能进行获多或少的修改,API不稳定行问题在通知上面凸显的尤其严重。
* 解决方案是:用support库中提供的兼容API。support-v4库中提供了一个NotificationCompat类,使用它可以保证我们的
* 程序在所有的Android系统版本中都能正常工作。
*/
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
// 设置通知的小图标
builder.setSmallIcon(R.mipmap.ic_launcher);
// 设置通知的大图标,当下拉系统状态栏时,就可以看到设置的大图标
builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher));
// 当通知被点击的时候,跳转到MainActivity中
builder.setContentIntent(pi);
// 设置通知的标题
builder.setContentreplacedle(replacedle);
if (progress > 0) {
// 当progress大于或等于0时,才需要显示下载进度
builder.setContentText(progress + "%");
builder.setProgress(100, progress, false);
}
return builder.build();
}
19
Source : CacheDownLoadService.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
@Override
public IBinder onBind(Intent intent) {
return binder;
}
19
Source : CacheDownLoadService.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
@Override
public boolean onUnbind(Intent intent) {
return false;
}
19
Source : VideoListFragment.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
@Override
public void launchActivity(Intent intent) {
}
19
Source : HotFragment.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
@Override
public void launchActivity(@NonNull Intent intent) {
checkNotNull(intent);
UiUtils.startActivity(intent);
}
19
Source : AuthorDetailActivity.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
@Override
public void launchActivity(@NonNull Intent intent) {
checkNotNull(intent);
}
19
Source : AuthorDetailActivity.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
private void gotoShare() {
if (mShareInfo == null)
return;
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, mShareInfo.getWechat_friends().getLink());
intent.setType("text/plain");
// 设置分享列表的标题,并且每次都显示分享列表
startActivity(Intent.createChooser(intent, "分享到"));
}
19
Source : AppFlutterActivity.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (!this.eventDelegate.onActivityResult(requestCode, resultCode, data)) {
super.onActivityResult(requestCode, resultCode, data);
}
}
19
Source : AppFlutterActivity.java
with Apache License 2.0
from Zweihui
with Apache License 2.0
from Zweihui
protected void onNewIntent(Intent intent) {
this.eventDelegate.onNewIntent(intent);
}
19
Source : LoginActivity.java
with Apache License 2.0
from zurche
with Apache License 2.0
from zurche
@Override
public void startChatListActivity() {
Intent intent = new Intent(this, ChatActivity.clreplaced);
startActivity(intent);
showProgressBar(false);
}
19
Source : PhotoPickerIntent.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
/**
* To set some photos that have been selected before
* @param intent
* @param imagesUri Selected photos
*/
public static void setSelected(Intent intent, ArrayList<String> imagesUri) {
intent.putExtra(EXTRA_ORIGINAL_PHOTOS, imagesUri);
}
19
Source : PhotoPickerIntent.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
public static void setPhotoCount(Intent intent, int photoCount) {
intent.putExtra(EXTRA_MAX_COUNT, photoCount);
}
19
Source : PhotoPickerIntent.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
public static void setShowCamera(Intent intent, boolean showCamera) {
intent.putExtra(EXTRA_SHOW_CAMERA, showCamera);
}
19
Source : PhotoPickerIntent.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
public static void setShowGif(Intent intent, boolean showGif) {
intent.putExtra(EXTRA_SHOW_GIF, showGif);
}
19
Source : PhotoPickerIntent.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
public static void setColumn(Intent intent, int column) {
intent.putExtra(EXTRA_GRID_COLUMN, column);
}
19
Source : PhotoPagerActivity.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
@Override
public void onBackPressed() {
Intent intent = new Intent();
intent.putExtra(KEY_SELECTED_PHOTOS, pagerFragment.getPaths());
setResult(RESULT_OK, intent);
finish();
super.onBackPressed();
}
19
Source : UserCacheHelper.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
public void saveCropAvatarInBackgroud(final Intent data, final StringBuilder out) {
Observable<Intent> observable = Observable.just(data);
observable.map(new Func1<Intent, String>() {
@Override
public String call(Intent intent) {
Bundle extras = data.getExtras();
String path = null;
if (extras != null) {
Bitmap bitmap = extras.getParcelable("data");
if (bitmap != null) {
path = PathUtils.getAvatarCropPath();
Utils.saveBitmap(path, bitmap);
if (bitmap != null && bitmap.isRecycled() == false) {
bitmap.recycle();
}
}
}
return path;
}
}).subscribeOn(Schedulers.io()).unsubscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<String>() {
@Override
public void call(String s) {
out.append(s);
}
});
}
19
Source : LoginActivity.java
with Apache License 2.0
from zuoweitan
with Apache License 2.0
from zuoweitan
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0 && resultCode == 1) {
String username = data.getStringExtra("username");
String preplacedword = data.getStringExtra("preplacedword");
mLayout.setUserName(username);
mLayout.setPreplacedword(preplacedword);
}
}
19
Source : X5WebChromeClient.java
with Apache License 2.0
from zsxsoft
with Apache License 2.0
from zsxsoft
public void openFileChooser(final ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
parentEngine.cordova.startActivityForResult(new CordovaPlugin() {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
Uri result = intent == null || resultCode != Activity.RESULT_OK ? null : intent.getData();
Log.d(LOG_TAG, "Receive file chooser URL: " + result);
uploadMsg.onReceiveValue(result);
}
}, intent, FILECHOOSER_RESULTCODE);
}
19
Source : MainActivity.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
@Override
public void startSetingActivity() {
Intent mintet = new Intent(MainActivity.this, AboutActivity.clreplaced);
this.startActivity(mintet);
}
19
Source : MainActivity.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
}
19
Source : MainActivity.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
// 打开新的搜索界面
@Override
public void startSearchActivity() {
Intent mintent = new Intent(this, SearchActivity.clreplaced);
startActivity(mintent);
}
19
Source : MainActivity.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
// 打开数据图表分析界面
private void initChartActiviy() {
Intent mintent = new Intent(MainActivity.this, DataChartActivity.clreplaced);
this.startActivity(mintent);
}
19
Source : ListActivity.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
private void sharedNotetexttoWeChart(String text) {
// 将便签文字分享到微信或者QQ等,主要调用系统分享控件
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, text);
startActivity(Intent.createChooser(intent, "share"));
}
19
Source : NoteFragment.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
private void shareDialog(String url) {
// 创建分享菜单界面
Intent mintent = new Intent(Intent.ACTION_SEND);
mintent.setType("text/plain");
mintent.putExtra(Intent.EXTRA_TEXT, "http://daily.zhihu.com/story/" + url);
startActivity(mintent);
}
19
Source : Movie_topFragment.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
private void shareDialog(String url) {
// 创建分享菜单界面
Intent mintent = new Intent(Intent.ACTION_SEND);
mintent.setType("text/plain");
mintent.putExtra(Intent.EXTRA_TEXT, "http://m.douban.com/movie/subject/" + url + "/mobile");
startActivity(mintent);
}
19
Source : HappyFragment.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
private void shareDialog(String url, String replacedle) {
// 创建分享菜单界面
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "分享");
startActivity(intent);
/*Glide.with(getContext())
.load(url)
.asBitmap()
.toBytes()
.into(new SimpleTarget<byte[]>() {
@Override
public void onResourceReady(byte[] resource, GlideAnimation<? super byte[]> glideAnimation) {
File pictureFolder=Environment.getExternalStorageDirectory();
File appdir=new File(pictureFolder,"/jishare");
if (!appdir.exists()){
appdir.mkdir();
}
String filename=System.currentTimeMillis()+".jpg";
File destfile=new File(appdir,filename);
if (SaveImageUtil.copyfile(resource,destfile)){
Toast.makeText(getContext(), "图片保存成功", Toast.LENGTH_SHORT).show();
getActivity().sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
Uri.fromFile(new File(appdir.getAbsoluteFile(),filename))));
Intent mintent=new Intent(Intent.ACTION_SEND);
mintent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(new File(appdir.getAbsoluteFile(),filename)));
mintent.setType("image/*");
startActivity(mintent);
}else {
Toast.makeText(getContext(), "图片分享失败+内存", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable) {
super.onLoadFailed(e, errorDrawable);
Toast.makeText(getContext(), "图片分享失败+glide", Toast.LENGTH_SHORT).show();
}
});*/
}
19
Source : Code_projectFragment.java
with Apache License 2.0
from zqljintu
with Apache License 2.0
from zqljintu
private void shareDialog(String url) {
// 创建分享菜单界面
Intent mintent = new Intent(Intent.ACTION_SEND);
mintent.setType("text/plain");
mintent.putExtra(Intent.EXTRA_TEXT, url);
startActivity(mintent);
}
See More Examples