Note that there are some explanatory texts on larger screens.

plurals
  1. PORun Twitter Application From My Application To Open A Specific Twitter Account
    primarykey
    data
    text
    <p>I have searched for this today <a href="https://stackoverflow.com/questions/6901538/open-twitter-app-from-other-app-and-load-some-page">Open Twitter app from other app and load some page</a> the code is from that post</p> <pre><code>try{ Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_TEXT, "this is a tweet"); intent.setType("text/plain"); final PackageManager pm = getPackageManager(); final List&lt;?&gt; activityList = pm.queryIntentActivities(intent, 0); int len = activityList.size(); for (int i = 0; i &lt; len; i++) { final ResolveInfo app = (ResolveInfo) activityList.get(i); if ("com.twitter.android.PostActivity".equals(app.activityInfo.name)) { final ActivityInfo activity=app.activityInfo; final ComponentName name=new ComponentName(activity.applicationInfo.packageName, activity.name); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); intent.setComponent(name); startActivity(intent); break; } } } catch(final ActivityNotFoundException e) { Log.i("twitter", "no twitter native",e ); } </code></pre> <p>and its working perfect.</p> <p>My question is if I can insert something at this code to open a specific Twitter account, for example to open the Twitter account from my website.</p> <p>Thanks</p> <p><strong>UPDATE</strong></p> <pre><code>myWebView = (WebView) findViewById(R.id.webview); // Create an instance of WebView and set it to the layout component created with id webview in main.xml myWebView.getSettings().setJavaScriptEnabled(true); myWebView.loadUrl("https://mobile.twitter.com/XXXXXXXXXXXX"); // Specify the URL to load when the application starts //myWebView.loadUrl("file://sdcard/"); // Specify a local file to load when the application starts. Will only load file types WebView supports myWebView.setWebViewClient(new WebViewKeep()); myWebView.setInitialScale(1); // Set the initial zoom scale myWebView.getSettings().setBuiltInZoomControls(true); // Initialize zoom controls for your WebView component myWebView.getSettings().setUseWideViewPort(true); // Initializes double-tap zoom control myWebView.getSettings().setUserAgentString("blablabla"); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload