• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps webview and my website dating

david212

Lurker
hello
i create a webesite for metting and when i use url for my website in browser mobile all work correctly also add picture for profil
but when i create webview apk with url of my website add picture not work
can you help me
thanx
 
Possibly, but you need to explain what the problem is, and provide some code.
 
this its MainActivity.java

package example.com.pakctage;


import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

public class MainActivity extends ActionBarActivity {

///////////////////////debut-webview




// Remove the below line after defining your own ad unit ID.
// private static final String TOAST_TEXT = "Test ads are being shown. "
// + "To show live ads, replace the ad unit ID in res/values/strings.xml with your own ad unit ID.";

private WebView WebView;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

WebView = (WebView) findViewById(R.id.webview);

// Force links and redirects to open in the WebView instead of in a browser
WebView.setWebViewClient(new WebViewClient());


// Enable Javascript
WebSettings webSettings = WebView.getSettings();
webSettings.setJavaScriptEnabled(true);



// Use remote resource
WebView.loadUrl("http://mywebsitemeeting.com/");

// Stop local links and redirects from opening in browser instead of WebView
// mWebView.setWebViewClient(new MyAppWebViewClient());

// Use local resource
// mWebView.loadUrl("file:///android_asset/www/index.html");

///////////////////////fin weview

// Load an ad into the AdMob banner view.
AdView adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.setRequestAgent("android_studio:ad_template").build();
adView.loadAd(adRequest);

// Toasts the test ad message on the screen. Remove this after defining your own ad unit ID.
// Toast.makeText(this, TOAST_TEXT, Toast.LENGTH_LONG).show();
}


@override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return false;
}

@override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

if (id == R.id.action_settings) {
return false;
}

return super.onOptionsItemSelected(item);
}



@override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
if (WebView.canGoBack()) {
WebView.goBack();
} else {
finish();
}
return true;
}

}
return super.onKeyDown(keyCode, event);
}}
 
Couple of points:-

1. Put the code in a nicely formatted code insert.
2. You haven't explained what the problem is "add picture not work" means nothing.
 
Back
Top Bottom