Skip to content Skip to sidebar Skip to footer

How To Set User Agent For New Action_view Intent

In my application I am launching a new Intent with url (browser) using the following code: Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(url)); try {

Solution 1:

  1. One can not programmatically set (from within an app) user's browser to display a custom user-agent string. However, users can do this by hand via some fiddling, but then this is set system wide.

  2. If you need to send custom user-agent, you can embedded browser into your app via WebView. Then you can set custom user-agent.

Solution 2:

myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);

might help you.

Post a Comment for "How To Set User Agent For New Action_view Intent"