Unfotunately, My Application has stopped hatası
Merhabalar.
Bu sorunla karşılaştım neden olduğunu anlayamıyorum. Yardımcı olur musunuz?
package com.ykyazilim.myapplication;
import android.content.Intent;
import android.net.Uri; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; import android.webkit.WebView; import android.widget.Button; import android.widget.LinearLayout; import com.google.ads.AdSize; import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
public class MainActivity extends AppCompatActivity {
Button yemek,obs,aka; private AdView adView = new AdView(this); @Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
yemek = (Button) findViewById(R.id.button); obs = (Button) findViewById(R.id.button2); aka = (Button) findViewById(R.id.button3);
reklamYukle(); yemek.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://yemeklistesi.trakya.edu.tr/")); startActivity(intent); } });
obs.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://obs.trakya.edu.tr/"));
startActivity(intent); } });
aka.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://akademiktakvim.trakya.edu.tr/"));
startActivity(intent); } }); }
private void reklamYukle() {
adView = new AdView(this); adView.setAdSize(com.google.android.gms.ads.AdSize.BANNER);
adView.setAdUnitId(getString(R.string.reklam_kimliği));
LinearLayout layout = (LinearLayout) findViewById(R.id.reklam); layout.addView(adView); AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).build();
adView.loadAd(adRequest); } }