Skip to main content

Ian Wu 's Library tagged android-programming   View Popular, Search in Google

Jun
22
2011

  • Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:VIDEO_ID")); startActivity(i);
Jun
21
2011

  • android:installLocation="auto"
  • ndroid:installLocation="a

  • private boolean isNetworkAvailable() {
       
    ConnectivityManager connectivityManager
             
    = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
       
    NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
       
    return activeNetworkInfo != null;
    }
  • <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Jun
8
2011

    • mWebView.setWebViewClient(new WebViewClient(){  
    •     public boolean shouldOverrideUrlLoading(WebView view, String url) {  
    •         view.loadUrl(url);  
    •         return true;  
    •     }  
    • });  

要分享某個項目時,用 intent 去通知 android 開啟 分享的 dialog

android android-programming intent

  • Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Some text"); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Some other text");  startActivity(Intent.createChooser(shareIntent, "Title for chooser"));
Jun
4
2011

intent 同一個 activity 時要用 onNewIntent 去改變不同的參數

同時也要設定 android:launchMode 

android android-programming intent

  • The thing here is, that your re-use an instance of your activity 'A'. 
    In this case, the activity's 'onCreate' is not called. Instead, its 
    'onNewIntent' is called.
1 - 20 of 48 Next › Last »
Showing 20 items per page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo
Move to top