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?