Avoiding the application to be open within other apps.
This commit is contained in:
parent
e061c6da88
commit
ff852c695c
Binary file not shown.
@ -14,15 +14,15 @@
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
android:exported="true"
|
||||
android:documentLaunchMode="intoExisting"
|
||||
android:launchMode="singleInstance">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<action android:name="android.content.Intent.ACTION_CREATE_SHORTCUT" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".OpenUrl"/>
|
||||
<activity-alias
|
||||
android:name=".OpenUrl"
|
||||
android:exported="true"
|
||||
|
@ -31,6 +31,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
private WebView webView;
|
||||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private RelativeLayout relativeLayout;
|
||||
String baseUrl = "https://burguillos.info";
|
||||
|
||||
private static Bitmap getBitmap(String url) {
|
||||
try {
|
||||
@ -109,7 +110,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
webView.addJavascriptInterface(new WebCallsAndroidCode(), "Android");
|
||||
Intent resultIntent = getIntent();
|
||||
|
||||
String baseUrl = "https://burguillos.info";
|
||||
String url = baseUrl;
|
||||
url = getCorrectUrlForIntent(resultIntent, url);
|
||||
|
||||
@ -136,6 +136,13 @@ public class MainActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
protected void onNewIntent(Intent resultIntent) {
|
||||
super.onNewIntent(resultIntent);
|
||||
String url = baseUrl;
|
||||
url = getCorrectUrlForIntent(resultIntent, url);
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
|
||||
public static String getCorrectUrlForIntent(Intent resultIntent, String url) {
|
||||
Bundle extras = resultIntent.getExtras();
|
||||
if(extras != null)
|
||||
|
@ -1,30 +0,0 @@
|
||||
package info.burguillos.bi;
|
||||
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.util.Log;
|
||||
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.MotionEvent;
|
||||
import android.content.Intent;
|
||||
import android.app.PendingIntent;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import android.view.View;
|
||||
import android.net.Uri;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Icon;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.content.pm.ShortcutManager;
|
||||
|
||||
public class OpenUrl extends AppCompatActivity {
|
||||
}
|
Loading…
Reference in New Issue
Block a user