1
0
Fork 0
mirror of https://github.com/ethauvin/Clever.git synced 2025-04-24 08:27:11 -07:00

Implemented http/https intent filters.

Added auto location to manifest (move to SD, etc.)
This commit is contained in:
Erik C. Thauvin 2012-09-10 19:03:18 -07:00
parent 139603176e
commit dcfc738fe0
3 changed files with 23 additions and 1 deletions

1
.gitignore vendored
View file

@ -18,6 +18,7 @@ local.properties
# Eclipse project files
.classpath
.project
.settings
#Mac

View file

@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.clever"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0" >
@ -25,6 +26,15 @@
<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>
</application>

View file

@ -2,6 +2,7 @@ package io.clever;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.util.Log;
@ -166,7 +167,17 @@ public class MainActivity extends Activity {
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");
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();
}