-1

I have tried many times to upload my app, that has a json from Wordpress and webview to open a link from json, I made the changes that was suggested here. But, when I try to upload, Google sends me this message:

Modify your app to make sure it doesn’t access or use a service or API in a manner that violates its terms of service; for example, by enabling background play of YouTube videos.

This is my webview code:

public class Webview extends AppCompatActivity {

WebView myWebView;
private boolean mShouldPause;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_webview);

    String link = getIntent().getStringExtra("link");

    myWebView = (WebView) findViewById(R.id.vebview);
    myWebView.loadUrl(link);

    WebSettings webSettings = myWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);

    myWebView.setWebViewClient(new WebViewClient(){
        @Override
        public void onLoadResource(WebView webview, String url) {
            super.onLoadResource(webview, url);
            if (url.contains("youtube.com")) mShouldPause = true;
        }

    });

    //button for share the link of webview
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plain");
            String shareBody = "you body here";
            String shareSub= "suject here";
            intent.putExtra(Intent.EXTRA_SUBJECT,shareSub);
            intent.putExtra(Intent.EXTRA_TEXT,shareBody);
            startActivity(Intent.createChooser(intent,"Compartilhe"));
        }
    });
}

@Override
public void onPause() {
    super.onPause();
    if(mShouldPause){
        myWebView.onPause();
    }
    mShouldPause = false;
}

Somebody knows what I'm doing wrong?

Community
  • 1
  • 1
Daniel Beltrami
  • 756
  • 9
  • 22
  • I'm voting to close this question as off-topic because its about the ToS of a 3rd party site, not about programming – Gabe Sechan Apr 22 '17 at 15:54
  • The problem was not in the third party but in the app, I forgot a permission as well as in the editing of my question – Daniel Beltrami Apr 23 '17 at 15:12
  • I've moved your answer below, and someone has commented on it - I think that comment was for you, see below. – halfer May 04 '17 at 08:08

1 Answers1

0

(Posted on behalf of the OP).

I found the solution, and was in my app, I miss the permission on manifest file

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
halfer
  • 19,824
  • 17
  • 99
  • 186
  • Just also remember that when you first start the app it should ask the user for permissions. Or at least permissions with a security risk. In older android apps(SDK) this was not necessary. But in the new SDK if you don't handle the permissions or ask for permissions it will also crash. – Renier May 04 '17 at 08:06