下载地址:http://static.apk.hiapk.com/html/2012/05/591429.html
---------HahamxActivity
---------
package hahamx.co.cc;
import net.youmi.android.AdManager;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
public class HahamxActivity extends Activity {
private WebView webView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
AdManager.init(HahamxActivity.this, "69302b9fb840e275",
"cf8fb8723c43fe30 ", 30, false);
setContentView(R.layout.main);
//webView = (WebView) findViewById(R.id.webview1);
//ProxyBridge pBridge = new ProxyBridge();
//webView.addJavascriptInterface(pBridge, "AliansBridge");
//WebSettings wSet = webView.getSettings();
//wSet.setJavaScriptEnabled(true);
//webView.loadUrl("file:///android_asset/naojing.htm");
//TextView mTextView=(TextView)findViewById(R.id.webview1);
WebView mWebView=(WebView)findViewById(R.id.webview1);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.loadUrl("file:///android_asset/index.htm");
}
protected void dialog() {
AlertDialog.Builder builder = new Builder(HahamxActivity.this);
builder.setTitle("趣味笑话软件");
builder.setMessage("你真的要退出趣味笑话软件吗?");
builder.setIcon(R.drawable.icon);
builder.setPositiveButton("否",
new android.content.DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.setNegativeButton("是",
new android.content.DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
android.os.Process.killProcess(android.os.Process
.myPid());
}
});
builder.create().show();
}
public void onBackPressed() {
dialog();
}
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
SubMenu subMenu2 = menu.addSubMenu(0, 2, 0, "整人脑经急转弯");
SubMenu subMenu3 = menu.addSubMenu(0, 3, 0, "冷笑话");
SubMenu subMenu4 = menu.addSubMenu(0, 4, 0, "春节对联大全");
SubMenu subMenu5 = menu.addSubMenu(0, 5, 0, "英文谚语");
SubMenu subMenu = menu.addSubMenu(0, 6, 0, "软件简介");
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId()) {
case 6:
AlertDialog.Builder builder = new Builder(HahamxActivity.this);
builder.setTitle("哈哈MX 笑话!");
builder.setMessage(R.string.about);
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
builder.create().show();
break;
case 3:
Intent intent=new Intent(HahamxActivity.this,xiaohua3.class);
startActivity(intent);
break;
case 2:
Intent intent1=new Intent(HahamxActivity.this,xiaohua.class);
startActivity(intent1);
break;
case 4:
Intent intent4=new Intent(HahamxActivity.this,chunjie.class);
startActivity(intent4);
break;
case 5:
Intent intent5=new Intent(HahamxActivity.this,yanyu.class);
startActivity(intent5);
break;
default:
break;
}
return super.onOptionsItemSelected(item);
}
public class ProxyBridge {
public int one() {
return 1;
}
}
}
------------CHUNJIE
package hahamx.co.cc;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class chunjie extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main4);
WebView mWebView4=(WebView)findViewById(R.id.webview4);
mWebView4.loadUrl("file:///android_asset/index4.htm");
mWebView4.getSettings().setBuiltInZoomControls(true);
}
}
----XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:umadsdk="http://schemas.android.com/apk/res/hahamx.co.cc"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
xmlns:umadsdk="http://schemas.android.com/apk/res/hahamx.co.cc"
android:layout_marginTop="1px"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<net.youmi.android.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
umadsdk:backgroundColor="#4076AA"
umadsdk:backgroundTransparent="255"
umadsdk:textColor="#ffffff" >
</net.youmi.android.AdView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<WebView
android:id="@+id/webview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</WebView>
</LinearLayout>
</LinearLayout>