Search in sources :

Example 1 with Intent

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"));
    }
}
Also used : Intent(android.content.Intent)

Example 2 with Intent

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);
}
Also used : Intent(android.content.Intent) Uri(android.net.Uri)

Example 3 with Intent

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);
}
Also used : Once(me.drakeet.meizhi.util.Once) Intent(android.content.Intent)

Example 4 with 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);
    }
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 5 with 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);
}
Also used : Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)30598 PendingIntent (android.app.PendingIntent)4802 Test (org.junit.Test)2560 View (android.view.View)2527 Bundle (android.os.Bundle)2094 ComponentName (android.content.ComponentName)1706 TextView (android.widget.TextView)1660 Uri (android.net.Uri)1607 Context (android.content.Context)1506 ResolveInfo (android.content.pm.ResolveInfo)1397 PackageManager (android.content.pm.PackageManager)1125 ArrayList (java.util.ArrayList)1067 IntentFilter (android.content.IntentFilter)917 ImageView (android.widget.ImageView)904 ActivityNotFoundException (android.content.ActivityNotFoundException)859 File (java.io.File)823 RemoteException (android.os.RemoteException)786 DialogInterface (android.content.DialogInterface)752 IOException (java.io.IOException)742 SharedPreferences (android.content.SharedPreferences)665