mirror of
https://github.com/ethauvin/Clever.git
synced 2025-04-25 08:57:12 -07:00
Merge pull request #2 from ethauvin/master
Implemented http/https intent filters.
This commit is contained in:
commit
7e500239de
3 changed files with 23 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -18,6 +18,7 @@ local.properties
|
||||||
# Eclipse project files
|
# Eclipse project files
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
|
.settings
|
||||||
|
|
||||||
#Mac
|
#Mac
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.clever"
|
package="io.clever"
|
||||||
|
android:installLocation="auto"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0" >
|
android:versionName="1.0" >
|
||||||
|
|
||||||
|
@ -25,6 +26,15 @@
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</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>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package io.clever;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -166,7 +167,17 @@ public class MainActivity extends Activity {
|
||||||
webSettings
|
webSettings
|
||||||
.setUserAgentString("Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Large Screen Safari/534.24 GoogleTV");
|
.setUserAgentString("Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Large Screen Safari/534.24 GoogleTV");
|
||||||
|
|
||||||
webView.loadUrl(HOME_PAGE);
|
final Intent intent = getIntent();
|
||||||
|
if ((intent.getAction() == Intent.ACTION_VIEW)
|
||||||
|
&& (intent.getData() != null)) {
|
||||||
|
final String url = intent.getDataString();
|
||||||
|
urlField.setText(url);
|
||||||
|
webView.loadUrl(url);
|
||||||
|
navbar.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
webView.loadUrl(HOME_PAGE);
|
||||||
|
}
|
||||||
|
|
||||||
webView.requestFocus();
|
webView.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue