【发布时间】:2017-07-01 18:20:47
【问题描述】:
在 Android 开发方面,我是初学者。这是我的第一个应用程序。我想知道每次按下按钮时如何显示 Admob 插页式广告。这是我的代码:
package hamza.guideforx.com.guideforx;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onButtonClick(View v) {
if (v.getId() == R.id.Bdisplay) ;
{
Intent i =new Intent(MainActivity.this, Display.class);
startActivity(i);
}
}
public void onButton1(View v1) {
if (v1.getId() == R.id.Button1) ;
{
Intent o =new Intent(MainActivity.this, Page.class);
startActivity(o);
}
}
public void onButton2(View v2) {
if (v2.getId() == R.id.Button2) ;
{
Intent q =new Intent(MainActivity.this, Page2.class);
startActivity(q);
}
}
}
提前致谢。
【问题讨论】:
-
您的代码中根本没有与 admob 相关的内容。你有没有尝试过?
-
@AlexanderKulyakhtin 不,我还没有尝试过任何东西,因为我不知道该怎么做
-
在就 Stack Overflow 寻求帮助之前,您真的应该尝试实现一些东西。当人们真正陷入困境或需要解释时,社区会在这里为他们提供帮助。
标签: java android android-studio admob interstitial