Q:

Which Mistake in Webview based Android Browser Application?

I'm making an Android Browser Application. Its splash image opens after loading but afterward it crashes. I haven't found what mistake I have in MainActivity.java code.
When i run the code, my default AVD tells me that my application has crashed.
MainActivity.java

package com.example.package;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;

public class MainActivity
  extends Activity
{
  private WebView a;
  @SuppressLint({"InlinedApi"})
  private BroadcastReceiver b = new a(this);
  
  public void a()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setTitle("Google");
    localBuilder.setMessage("Are you sure you want to Exit?");
    localBuilder.setIcon(2130837505);
    localBuilder.setPositiveButton("YES", new d());
    localBuilder.setNegativeButton("NO", new e());
    localBuilder.show();
  }
  
  public void onBackPressed()
  {
    a();
  }
  
  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(2);
    setContentView(2130903042);
    this.a = ((WebView)findViewById(2131230720));
    this.a.getSettings().setJavaScriptEnabled(true);
    this.a.setFocusableInTouchMode(true);
    this.a.getSettings().setLoadWithOverviewMode(true);
    this.a.getSettings().setUseWideViewPort(true);
    this.a.getSettings().setLoadsImagesAutomatically(true);
    this.a.loadUrl("http://www.google.com");
    this.a.setWebChromeClient(new b(this));
    this.a.setDownloadListener(new c());
    this.a.setWebViewClient(new f());
  }
  
  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    super.onCreateOptionsMenu(paramMenu);
    paramMenu.add(0, 1, 0, "Home").setIcon(2130837506);
    paramMenu.add(0, 2, 0, "Downloads").setIcon(2130837504);
    paramMenu.add(0, 3, 0, "Back").setIcon(2130837506);
    paramMenu.add(0, 4, 0, "Forward").setIcon(2130837505);
    paramMenu.add(0, 5, 0, "Refresh").setIcon(2130837509);
    return true;
  }
  
  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if ((paramInt == 4) && (this.a.canGoBack()))
    {
      this.a.goBack();
      return true;
    }
    return super.onKeyDown(paramInt, paramKeyEvent);
  }
  
  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    super.onOptionsItemSelected(paramMenuItem);
    switch (paramMenuItem.getItemId())
    {
    default: 
      return false;
    case 1: 
      this.a.loadUrl("http://www.google.com");
      return true;
    case 3: 
      this.a.goBack();
      return true;
    case 5: 
      this.a.reload();
      return true;
    case 4: 
      this.a.goForward();
      return true;
    }
  }
  
  protected void onPause()
  {
    super.onPause();
    unregisterReceiver(this.b);
  }
  
  @SuppressLint({"InlinedApi"})
  protected void onResume()
  {
    IntentFilter localIntentFilter = new IntentFilter("android.intent.action.DOWNLOAD_COMPLETE");
    registerReceiver(this.b, localIntentFilter);
    super.onResume();
  }
}

a.java

package com.example.package;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.widget.Toast;

class a
  extends BroadcastReceiver
{
  a(MainActivity paramMainActivity) {}
  
  public void onReceive(Context paramContext, Intent paramIntent)
  {
    Toast.makeText(paramContext, paramContext.getResources().getString(2131034114), 0).show();
  }

public static void finish() {
 // TODO Auto-generated method stub
 
}

public static void startActivity(Intent localIntent) {
 // TODO Auto-generated method stub
 
}
}

g.java

package com.example.package;

import android.app.Activity;
import android.content.Intent;
import java.util.TimerTask;

class g
  extends TimerTask
{
  private Object a;

g(splash paramsplash) {}
  
  public void run()
  {
    ((Activity) this.a).finish();
    Intent localIntent = new Intent();
    ((Activity) this.a).startActivity(localIntent);
  }
}

A:

Your problem is almost certainly the issue:
this.a = ((WebView)findViewById(2131230720));

The number "2131230720" is a static reference int to resources, in this case a layout view in your Activity. That number comes from R.java which is created when you "build" your project. Each time you perform a build, it will assign an integer to layout objects, strings, etc. that you define in XML in your res folder.
Using the integer value might work for a while (or is present in source code), but then you change your layouts (or other R objects like strings) or rebuild on a different machine, Android library, etc. and it doesn't work anymore; 
That line should look like this:
this.a = ((WebView)findViewById(R.id.my_webview_layout_id));

where "my_webview_layout_id" is from your layout XML file. You should find the "id" of the XML defined object in an XML file in res/layout Use that @+id reference. That will keep track of changes to that static reference.
Then when you build or rebuild your Android app, it will create the R.java file with all of the appropriate references. 

