Permalink
Browse files

receive intent

  • Loading branch information...
hiroyuki12 committed Feb 12, 2013
1 parent c9e727c commit c49252a1b713ea65b2b1cc24e68a10c898f92ca2
Showing with 12 additions and 1 deletion.
  1. +7 −1 AndroidManifest.xml
  2. +5 −0 src/android/sample/MainActivity.java
View
@@ -21,9 +21,15 @@
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
-
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE"/>
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ </intent-filter>
</activity>
<activity android:name=".BookmarkActivity"></activity>
<activity android:name=".SettingActivity"></activity>
@@ -124,6 +124,11 @@ public boolean onLongClick(View v) {
String sKey1 = extras.getString("url");
webView.loadUrl(sKey1);
}
+ else if (Intent.ACTION_VIEW.equals(getIntent().getAction()) ){
+ //暗黙的インテント経由で起動された時の処理
+ String url = getIntent().getDataString();
+ webView.loadUrl(url);
+ }
else
{
webView.loadUrl("http://www.nikkei.com/");

0 comments on commit c49252a

Please sign in to comment.