使用 YouTube App 搜尋影片

    Intent youtubeIntent = new Intent(Intent.ACTION_SEARCH);
    youtubeIntent.setPackage("com.google.android.youtube");
    youtubeIntent.putExtra("query", song.getTitle());
    youtubeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(youtubeIntent);

    將內容發送出去

    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setType("text/plain");
    shareIntent.putExtra(Intent.EXTRA_SUBJECT, shareTitle);
    shareIntent.putExtra(Intent.EXTRA_TEXT, shareDescription);
    startActivity(Intent.createChooser(shareIntent, "Share"));

    到設定理的網路設定

    Intent intent = new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS);
    startActivity(intent);
    Was this page helpful?
    標籤 (Edit tags)
    • No tags
    blog comments powered by Disqus
    Powered by MindTouch Core