当有人点击广告并返回应用程序时,应用程序不会恢复。我已android:launchMode="singleInstance"
在 mainfest 和android:alwaysRetainTaskState="true"
清单中的活动声明中添加。
我不知道我要去哪里错了。
我的 .java 文件代码如下:
public class MainActivity extends Activity implements AdListener{
public static int count=0,dispad=0;
public static LinearLayout lay1;
private static final Class<?>[] NUMBERS = {First.class};
protected AdView adView;
View admobAds;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
adView = (AdView)findViewById(R.id.ad);
Toast toast = Toast.makeText(getApplicationContext(), "Click on the ad to
make it disappear" +
"", Toast.LENGTH_LONG);
toast.show();
adView.loadAd(new AdRequest());
lay1=(LinearLayout)this.findViewById(R.id.mainlay);
admobAds = (View) findViewById(R.id.ad);
//More code
public void onDismissScreen(Ad arg0) {
lay1.removeView(admobAds);
dispad=1;
// TODO Auto-generated method stub
}
}