i am a react native dev so dont know about native code
i want to close the current tab and open new tab with custom website and it should work for any browser out there
how can i do that
public void performRedirect(String browserPackage) { Log.v(TAG, browserPackage); try { Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("https://www.google.com")); intent.setPackage(browserPackage); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Bundle b = new Bundle(); b.putBoolean("new_window", true); intent.putExtras(b); startActivity(intent); } catch (Exception e) { Log.e(TAG,e+""); } }
i tried this but it opens new tab but does not close current tab