use of android.content.Intent in project WilliamChart by diogobernardino.
the class SandboxFragment method onPlay.
void onPlay(View view) {
if (view.getId() == R.id.sandbox_play_play) {
generateChart();
} else {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, buildCode());
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, "Send code"));
}
}
use of android.content.Intent in project Meizhi by drakeet.
the class WebActivity method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch(id) {
case R.id.action_refresh:
refresh();
return true;
case R.id.action_copy_url:
String copyDone = getString(R.string.tip_copy_done);
Androids.copyToClipBoard(this, mWebView.getUrl(), copyDone);
return true;
case R.id.action_open_url:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri uri = Uri.parse(mUrl);
intent.setData(uri);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
} else {
Toasts.showLong(R.string.tip_open_fail);
}
return true;
}
return super.onOptionsItemSelected(item);
}
use of android.content.Intent in project Meizhi by drakeet.
the class BaseActivity method loginGitHub.
protected void loginGitHub() {
new Once(this).show(R.string.action_github_login, () -> {
Toasts.showLongX2(getString(R.string.tip_login_github));
});
String url = getString(R.string.url_login_github);
Intent intent = WebActivity.newIntent(this, url, getString(R.string.action_github_login));
startActivity(intent);
}
use of android.content.Intent in project Meizhi by drakeet.
the class MainActivity method startPictureActivity.
private void startPictureActivity(Meizhi meizhi, View transitView) {
Intent intent = PictureActivity.newIntent(MainActivity.this, meizhi.url, meizhi.desc);
ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this, transitView, PictureActivity.TRANSIT_PIC);
try {
ActivityCompat.startActivity(MainActivity.this, intent, optionsCompat.toBundle());
} catch (IllegalArgumentException e) {
e.printStackTrace();
startActivity(intent);
}
}
use of android.content.Intent in project Meizhi by drakeet.
the class MainActivity method openGitHubTrending.
private void openGitHubTrending() {
String url = getString(R.string.url_github_trending);
String title = getString(R.string.action_github_trending);
Intent intent = WebActivity.newIntent(this, url, title);
startActivity(intent);
}
Aggregations