I've read the post that everyone links to about link handling clicks with TextViews.
I have a textview with a Movement method set and it seems to be working correctly. When I click on the link it opens a browser and displays the correct information.
My FormatUtils.generateHtml class takes markdown from submission.getContent() and creates usable links as well as formates the text to bold and italics and such.
For some reason I am stumped on how to get that info to load into my own webview.
My manifest for the activity
<activity android:name="com.matteo.example.view.activities.SubmissionDetailActivity">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<data android:scheme="com.matteo.example" />
</intent-filter>
</activity>
Linked Textview
CharSequence string = FormatUtils.generateHtml(submission.getContent());
formattedContent.setText(string);
formattedContent.setMovementMethod(LinkMovementMethod.getInstance());
in my Activity with the webview. These are my attepts to get the data in the intent. Am I even close here?
mywebview.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return true;
}
});
@Override
public void startActivity(Intent intent) {
if (TextUtils.equals(intent.getAction(), Intent.ACTION_VIEW)) {
Bundle extras = getIntent().getExtras();
intent = getIntent();
String extra = intent.getStringExtra();
Uri data = getIntent().getData();
mywebview.loadUrl(intent.toString());
Toast.makeText(this, "THIS IS INTENT DATA~~ " + intent.getDataString() , Toast.LENGTH_LONG).show();
So far it seems eveything is null.
How do I get the data from the Intent so I can handle it with my webview?