Example usage for android.app.assist AssistContent setWebUri

List of usage examples for android.app.assist AssistContent setWebUri

Introduction

In this page you can find the example usage for android.app.assist AssistContent setWebUri.

Prototype

public void setWebUri(Uri uri) 

Source Link

Document

Set a web URI associated with the current data being shown to the user.

Usage

From source file:com.commonsware.android.assist.mo.MainActivity.java

@TargetApi(23)
@Override//www.j  a v a2s  .c om
public void onProvideAssistContent(AssistContent outContent) {
    super.onProvideAssistContent(outContent);

    outContent.setWebUri(Uri.parse("https://commonsware.com"));

    try {
        JSONObject json = new JSONObject().put("@type", "Book").put("author", "https://commonsware.com/mmurphy")
                .put("publisher", "CommonsWare, LLC")
                .put("name", "The Busy Coder's Guide to Android Development");

        outContent.setStructuredData(json.toString());
    } catch (JSONException e) {
        Log.e(getClass().getSimpleName(), "Um, what happened here?", e);
    }
}

From source file:io.plaidapp.designernews.ui.story.StoryActivity.java

@Override
@TargetApi(Build.VERSION_CODES.M)/*from   w w  w.j a v a  2s. co m*/
public void onProvideAssistContent(AssistContent outContent) {
    if (story.getUrl() != null) {
        outContent.setWebUri(Uri.parse(story.getUrl()));
    }
}

From source file:io.plaidapp.ui.DribbbleShot.java

@Override
@TargetApi(Build.VERSION_CODES.M)
public void onProvideAssistContent(AssistContent outContent) {
    outContent.setWebUri(Uri.parse(shot.url));
}

From source file:io.plaidapp.ui.DesignerNewsStory.java

@Override
@TargetApi(Build.VERSION_CODES.M)
public void onProvideAssistContent(AssistContent outContent) {
    outContent.setWebUri(Uri.parse(story.url));
}