Perhaps you will find the question that I'm going to ask to be too mainstream/basic. But I need help maybe I'm a newbie. Basically I'm making a simple app that displays maps about some tourist places in an offline manner.It has three activities. A - expandable list B - activity that displays a map using a webview C - TabHost that hosts the Activity B.
Whenever a child is clicked from the expandable list in the Activity A it sends two intents. 1) To Activity B giving the location of the desired map. 2) To Activity C to start the TabHost. Code is as follows:
if (childclicked=="Red Fort")
{
Intent toMap = new Intent(TourList.this,Map.class);
toMap.putExtra(ID , "file:///android_asset/redfort.jpg");
Intent i = new Intent(TourList.this,TourTabs.class);
startActivity(i);
}
and the code in the activity B is as follows:
public class Map extends Activity {
String imageUrl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
//Using a webview for pinch zooming
WebView vw=(WebView)findViewById(R.id.webView1);
vw.getSettings().setBuiltInZoomControls(true);
//Fetching intents
Intent fromList = getIntent();
imageUrl = fromList.getStringExtra(TourList.ID);
vw.loadUrl(imageUrl);
}
But the bug is runtime. Nothing gets displayed in the TabHost. The WebView does not display anything. Why? Please help.