title: android.view.InflateException: Binary XML file & Out of memory on a ...byte allocation
body: <p>There is a Video-game app and when I test with Samsung N-8010(1024*768) and Galaxy S2(640*480) it works fine however with Note 3(1920*1080) logcat showing me inflating error and out of memory. I read others about this but none of them was helpful. Can someone find my problem and solution ?</p>
  
  <p>I need to cut my xml but in line 212 it's just one of button and each run it's referring one of button in xml</p>
  
  <p>LogCat :</p>
  
  <pre><code>02-11 15:30:50.484: E/dalvikvm-heap(15795): Out of memory on a 2250016-byte allocation.
  02-11 15:30:50.489: I/dalvikvm(15795): "main" prio=5 tid=1 RUNNABLE
  02-11 15:30:50.489: I/dalvikvm(15795):   | group="main" sCount=0 dsCount=0 obj=0x417b6578 self=0x417a1648
  02-11 15:30:50.489: I/dalvikvm(15795):   | sysTid=15795 nice=0 sched=0/0 cgrp=apps handle=1074192380
  02-11 15:30:50.489: I/dalvikvm(15795):   | state=R schedstat=( 662807416 95096167 570 ) utm=36 stm=29 core=2
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.content.res.Resources.loadDrawable(Resources.java:2988)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.View.&lt;init&gt;(View.java:3563)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.widget.TextView.&lt;init&gt;(TextView.java:879)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.widget.Button.&lt;init&gt;(Button.java:108)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.widget.Button.&lt;init&gt;(Button.java:104)
  02-11 15:30:50.489: I/dalvikvm(15795):   at java.lang.reflect.Constructor.constructNative(Native Method)
  02-11 15:30:50.489: I/dalvikvm(15795):   at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.createView(LayoutInflater.java:600)
  02-11 15:30:50.489: I/dalvikvm(15795):   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
  02-11 15:30:50.489: I/dalvikvm(15795):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.Activity.setContentView(Activity.java:1956)
  02-11 15:30:50.489: I/dalvikvm(15795):   at com.example.anlatbanatest.Categoris.onCreate(Categoris.java:61)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.Activity.performCreate(Activity.java:5369)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.ActivityThread.access$700(ActivityThread.java:165)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.os.Handler.dispatchMessage(Handler.java:99)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.os.Looper.loop(Looper.java:137)
  02-11 15:30:50.489: I/dalvikvm(15795):   at android.app.ActivityThread.main(ActivityThread.java:5450)
  02-11 15:30:50.489: I/dalvikvm(15795):   at java.lang.reflect.Method.invokeNative(Native Method)
  02-11 15:30:50.489: I/dalvikvm(15795):   at java.lang.reflect.Method.invoke(Method.java:525)
  02-11 15:30:50.489: I/dalvikvm(15795):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
  02-11 15:30:50.489: I/dalvikvm(15795):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
  02-11 15:30:50.489: I/dalvikvm(15795):   at dalvik.system.NativeStart.main(Native Method)
  02-11 15:30:50.489: D/skia(15795): --- allocation failed for scaled bitmap
  02-11 15:30:50.494: D/AndroidRuntime(15795): Shutting down VM
  02-11 15:30:50.494: W/dalvikvm(15795): threadid=1: thread exiting with uncaught exception (group=0x417b5700)
  02-11 15:30:50.494: E/AndroidRuntime(15795): FATAL EXCEPTION: main
  02-11 15:30:50.494: E/AndroidRuntime(15795): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.anlatbanatest/com.example.anlatbanatest.Categoris}: android.view.InflateException: Binary XML file line #212: Error inflating class &lt;unknown&gt;
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2304)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.ActivityThread.access$700(ActivityThread.java:165)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.os.Handler.dispatchMessage(Handler.java:99)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.os.Looper.loop(Looper.java:137)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.ActivityThread.main(ActivityThread.java:5450)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at java.lang.reflect.Method.invokeNative(Native Method)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at java.lang.reflect.Method.invoke(Method.java:525)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at dalvik.system.NativeStart.main(Native Method)
  02-11 15:30:50.494: E/AndroidRuntime(15795): Caused by: android.view.InflateException: Binary XML file line #212: Error inflating class &lt;unknown&gt;
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.createView(LayoutInflater.java:626)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.Activity.setContentView(Activity.java:1956)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at com.example.anlatbanatest.Categoris.onCreate(Categoris.java:61)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.Activity.performCreate(Activity.java:5369)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    ... 11 more
  02-11 15:30:50.494: E/AndroidRuntime(15795): Caused by: java.lang.reflect.InvocationTargetException
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at java.lang.reflect.Constructor.constructNative(Native Method)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.LayoutInflater.createView(LayoutInflater.java:600)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    ... 26 more
  02-11 15:30:50.494: E/AndroidRuntime(15795): Caused by: java.lang.OutOfMemoryError
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.content.res.Resources.loadDrawable(Resources.java:2988)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.view.View.&lt;init&gt;(View.java:3563)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.widget.TextView.&lt;init&gt;(TextView.java:879)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.widget.Button.&lt;init&gt;(Button.java:108)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    at android.widget.Button.&lt;init&gt;(Button.java:104)
  02-11 15:30:50.494: E/AndroidRuntime(15795):    ... 29 more
  </code></pre>
  
  <p>xml :</p>
  
  <pre><code>                ....
                  ....
              &lt;Button
                  android:id="@+id/categories_button_yerli_tarihi_mekanlar"
                  android:layout_width="130dp"
                  android:layout_height="130dp"
                  android:layout_margin="20dp"
                  android:background="@drawable/yerli_tarihi_mekanlar" /&gt;
                  ....
                  ....
  </code></pre>
  
  <p>Code :</p>
  
  <pre><code>public class Categoris extends Activity {
  
      private Button help_button;
      private Button expand_button;
      private Button bt_90;
      private Button bt_bilim_teknoloji;
      private Button bt_bitkiler_alemi;
      private Button bt_cizgi_film;
      private Button bt_dizi_yabanci;
      private Button bt_dizi_yerli;
      private Button bt_filmler;
      private Button bt_hayvanlar_alemi;
      private Button bt_masallar_kahramanlar;
      private Button bt_oyunlar;
      private Button bt_sarkicilar_yabanci;
      private Button bt_sarkicilar_yerli;
      private Button bt_sehirler_tr;
      private Button bt_siyasiler;
      private Button bt_sporlar;
      private Button bt_super_kahramanlar;
      private Button bt_tarihi_kisi_yabanci;
      private Button bt_tarihi_kisi_yerli;
      private Button bt_tarihi_mekan_yabanci;
      private Button bt_tarihi_mekan_yerli;
      private Button bt_ulkeler;
      private Button bt_unlu_sehirler;
      private Button bt_unluler;
      private Button bt_yemekler;
      private Button bt_cizgi_film_kahraman;
      private Button bt_karisik;
  
      boolean doubleBackToExitPressedOnce = false;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.categories);
  
          DisplayMetrics displaymetrics = new DisplayMetrics();
          getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
          int height = displaymetrics.heightPixels;
          int width = displaymetrics.widthPixels;;
  
          Log.i("gen", String.valueOf(width));
          Log.i("yuk", String.valueOf(height));
  
  
          help_button = (Button) findViewById(R.id.categories_button_help);
          expand_button = (Button) findViewById(R.id.categories_button_expand);
  
          bt_90 = (Button) findViewById(R.id.categories_button_doksanlar);
          bt_bilim_teknoloji = (Button) findViewById(R.id.categories_button_bilim_teknoloji);
          bt_bitkiler_alemi = (Button) findViewById(R.id.categories_button_bitkiler_alemi);
          bt_cizgi_film = (Button) findViewById(R.id.categories_button_cizgi_filmler);
          bt_dizi_yabanci = (Button) findViewById(R.id.categories_button_yabaci_diziler);
          bt_dizi_yerli = (Button) findViewById(R.id.categories_button_yerli_diziler);
          bt_filmler = (Button) findViewById(R.id.categories_button_filmler);
          bt_hayvanlar_alemi = (Button) findViewById(R.id.categories_button_hayvanlar_alemi);
          bt_masallar_kahramanlar = (Button) findViewById(R.id.categories_button_masallar);
          bt_oyunlar = (Button) findViewById(R.id.categories_button_oyunlar);
          bt_sarkicilar_yabanci = (Button) findViewById(R.id.categories_button_yabanci_sarkicilar);
          bt_sarkicilar_yerli = (Button) findViewById(R.id.categories_button_yerli_sarkicilar);
          bt_sehirler_tr = (Button) findViewById(R.id.categories_button_sehirler);
          bt_siyasiler = (Button) findViewById(R.id.categories_button_siyasiler);
          bt_sporlar = (Button) findViewById(R.id.categories_button_sporlar);
          bt_super_kahramanlar = (Button) findViewById(R.id.categories_button_super_kahramanlar);
          bt_tarihi_kisi_yabanci = (Button) findViewById(R.id.categories_button_yabanci_tarihi_kisiler);
          bt_tarihi_kisi_yerli = (Button) findViewById(R.id.categories_button_yerli_tarihi_kisiler);
          bt_tarihi_mekan_yabanci = (Button) findViewById(R.id.categories_button_yabanci_tarihi_mekanlar);
          bt_tarihi_mekan_yerli = (Button) findViewById(R.id.categories_button_yerli_tarihi_mekanlar);
          bt_ulkeler = (Button) findViewById(R.id.categories_button_ulkeler);
          bt_unlu_sehirler = (Button) findViewById(R.id.categories_button_unlu_sehirler);
          bt_unluler = (Button) findViewById(R.id.categories_button_unluler);
          bt_yemekler = (Button) findViewById(R.id.categories_button_yemekler);
          bt_cizgi_film_kahraman = (Button) findViewById(R.id.categories_button_cizgi_film_kahraman);
          bt_karisik = (Button) findViewById(R.id.categories_button_karisik);
  
          help_button.setOnClickListener(onClickListener);
          expand_button.setOnClickListener(onClickListener);
          bt_90.setOnClickListener(onClickListener);
          bt_bilim_teknoloji.setOnClickListener(onClickListener);
          bt_bitkiler_alemi.setOnClickListener(onClickListener);
          bt_cizgi_film.setOnClickListener(onClickListener);
          bt_dizi_yabanci.setOnClickListener(onClickListener);
          bt_dizi_yerli.setOnClickListener(onClickListener);
          bt_filmler.setOnClickListener(onClickListener);
          bt_hayvanlar_alemi.setOnClickListener(onClickListener);
          bt_masallar_kahramanlar.setOnClickListener(onClickListener);
          bt_oyunlar.setOnClickListener(onClickListener);
          bt_sarkicilar_yabanci.setOnClickListener(onClickListener);
          bt_sarkicilar_yerli.setOnClickListener(onClickListener);
          bt_sehirler_tr.setOnClickListener(onClickListener);
          bt_siyasiler.setOnClickListener(onClickListener);
          bt_sporlar.setOnClickListener(onClickListener);
          bt_super_kahramanlar.setOnClickListener(onClickListener);
          bt_tarihi_kisi_yabanci.setOnClickListener(onClickListener);
          bt_tarihi_kisi_yerli.setOnClickListener(onClickListener);
          bt_tarihi_mekan_yabanci.setOnClickListener(onClickListener);
          bt_tarihi_mekan_yerli.setOnClickListener(onClickListener);
          bt_ulkeler.setOnClickListener(onClickListener);
          bt_unlu_sehirler.setOnClickListener(onClickListener);
          bt_unluler.setOnClickListener(onClickListener);
          bt_yemekler.setOnClickListener(onClickListener);
          bt_cizgi_film_kahraman.setOnClickListener(onClickListener);
          bt_karisik.setOnClickListener(onClickListener);
  
          ArrayList&lt;Button&gt; button_list = new ArrayList&lt;Button&gt;();
  
          button_list.add(bt_90);
          button_list.add(bt_bilim_teknoloji);
          button_list.add(bt_bitkiler_alemi);
          button_list.add(bt_cizgi_film);
          button_list.add(bt_dizi_yabanci);
          button_list.add(bt_dizi_yerli);
          button_list.add(bt_filmler);
          button_list.add(bt_hayvanlar_alemi);
          button_list.add(bt_masallar_kahramanlar);
          button_list.add(bt_oyunlar);
          button_list.add(bt_sarkicilar_yabanci);
          button_list.add(bt_sarkicilar_yerli);
          button_list.add(bt_sehirler_tr);
          button_list.add(bt_siyasiler);
          button_list.add(bt_sporlar);
          button_list.add(bt_super_kahramanlar);
          button_list.add(bt_tarihi_kisi_yabanci);
          button_list.add(bt_tarihi_kisi_yerli);
          button_list.add(bt_tarihi_mekan_yabanci);
          button_list.add(bt_tarihi_mekan_yerli);
          button_list.add(bt_ulkeler);
          button_list.add(bt_unlu_sehirler);
          button_list.add(bt_unluler);
          button_list.add(bt_yemekler);
          button_list.add(bt_cizgi_film_kahraman);
          button_list.add(bt_karisik);
  
          LinearLayout.LayoutParams lp_category = new LinearLayout.LayoutParams(((int)(width*0.24)), ((int)(width*0.24)));
          lp_category.setMargins(((int)(width*0.005)), 0, ((int)(width*0.005)), 0);
  
  
          for (Button b:button_list) {
  //          b.setLayoutParams(new LinearLayout.LayoutParams(((int)(width*0.24)), ((int)(width*0.24))));
              b.setLayoutParams(lp_category);
          }
  
          LinearLayout.LayoutParams lp_small_button = new LinearLayout.LayoutParams(((int)(height*0.1)), ((int)(height*0.1)));
  
          lp_small_button.setMargins(0, 0, ((int)(height*0.025)), ((int)(height*0.035)));
          help_button.setLayoutParams(lp_small_button);
          lp_small_button.setMargins(((int)(height*0.025)), 0, 0, ((int)(height*0.035)));
          expand_button.setLayoutParams(lp_small_button);
  
  
      }
  
      @Override
      public void onBackPressed() {
          if (doubleBackToExitPressedOnce) {
              if (VideoViewTest.videoPath != null) {
                  if (Result.isSaved == 0) {
                      File file = new File(VideoViewTest.videoPath);
                      if(file.exists())
                          file.delete();
                      finish();
                      System.exit(0);        
                  }
              }
              finish();
              System.exit(0);        
          }
          this.doubleBackToExitPressedOnce = true;
          Toast.makeText(this, "Please click BACK again to exit", Toast.LENGTH_SHORT).show();
          new Handler().postDelayed(new Runnable() {
  
              @Override
              public void run() {
                  doubleBackToExitPressedOnce=false;   
  
              }
          }, 2000);
      }
  
  
  
      private OnClickListener onClickListener = new OnClickListener() {
          @Override
          public void onClick(View v) {
              switch(v.getId()){
              case R.id.categories_button_help:
                  //DO something
                  break;
              case R.id.categories_button_expand:
                  Intent in = new Intent(getBaseContext(), CategoriesExpanded.class);
                  //              in.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                  startActivity(in);
                  finish();
                  break;
              case R.id.categories_button_doksanlar:
                  Intent in1 = new Intent(getBaseContext(), SelectedCategory.class);
                  in1.putExtra("id", DBHelper.ID_90);
                  startActivity(in1);
                  break;
              case R.id.categories_button_bilim_teknoloji:
                  Intent in2 = new Intent(getBaseContext(), SelectedCategory.class);
                  in2.putExtra("id", DBHelper.ID_BILIM_TEKNOLOJI);
                  startActivity(in2);
                  break;
              case R.id.categories_button_bitkiler_alemi:
                  Intent in3 = new Intent(getBaseContext(), SelectedCategory.class);
                  in3.putExtra("id", DBHelper.ID_BITKILER_ALEMI);
                  startActivity(in3);
                  break;
              case R.id.categories_button_cizgi_filmler:
                  Intent in4 = new Intent(getBaseContext(), SelectedCategory.class);
                  in4.putExtra("id", DBHelper.ID_CIZGI_FILM);
                  startActivity(in4);
                  break;
              case R.id.categories_button_yabaci_diziler:
                  Intent in5 = new Intent(getBaseContext(), SelectedCategory.class);
                  in5.putExtra("id", DBHelper.ID_DIZI_YABANCI);
                  startActivity(in5);
                  break;
              case R.id.categories_button_yerli_diziler:
                  Intent in6 = new Intent(getBaseContext(), SelectedCategory.class);
                  in6.putExtra("id", DBHelper.ID_DIZI_YERLI);
                  startActivity(in6);
                  break;
              case R.id.categories_button_filmler:
                  Intent in7 = new Intent(getBaseContext(), SelectedCategory.class);
                  in7.putExtra("id", DBHelper.ID_FILM);
                  startActivity(in7);
                  break;
              case R.id.categories_button_hayvanlar_alemi:
                  Intent in8 = new Intent(getBaseContext(), SelectedCategory.class);
                  in8.putExtra("id", DBHelper.ID_HAYVANLAR_ALEMI);
                  startActivity(in8);
                  break;
              case R.id.categories_button_masallar:
                  Intent in9 = new Intent(getBaseContext(), SelectedCategory.class);
                  in9.putExtra("id", DBHelper.ID_MASAL_KAHRAMAN);
                  startActivity(in9);
                  break;
              case R.id.categories_button_oyunlar:
                  Intent in10 = new Intent(getBaseContext(), SelectedCategory.class);
                  in10.putExtra("id", DBHelper.ID_OYUNLAR);
                  startActivity(in10);
                  break;
              case R.id.categories_button_yabanci_sarkicilar:
                  Intent in11 = new Intent(getBaseContext(), SelectedCategory.class);
                  in11.putExtra("id", DBHelper.ID_SARKICILAR_YABANCI);
                  startActivity(in11);
                  break;
              case R.id.categories_button_yerli_sarkicilar:
                  Intent in12 = new Intent(getBaseContext(), SelectedCategory.class);
                  in12.putExtra("id", DBHelper.ID_SARKICILAR_YERLI);
                  startActivity(in12);
                  break;
              case R.id.categories_button_sehirler:
                  Intent in13 = new Intent(getBaseContext(), SelectedCategory.class);
                  in13.putExtra("id", DBHelper.ID_SEHIR_TR);
                  startActivity(in13);
                  break;
              case R.id.categories_button_siyasiler:
                  Intent in14 = new Intent(getBaseContext(), SelectedCategory.class);
                  in14.putExtra("id", DBHelper.ID_SIYASILER);
                  startActivity(in14);
                  break;
              case R.id.categories_button_sporlar:
                  Intent in15 = new Intent(getBaseContext(), SelectedCategory.class);
                  in15.putExtra("id", DBHelper.ID_SPOR);
                  startActivity(in15);
                  break;
              case R.id.categories_button_super_kahramanlar:
                  Intent in16 = new Intent(getBaseContext(), SelectedCategory.class);
                  in16.putExtra("id", DBHelper.ID_SUPER_KAHRAMAN);
                  startActivity(in16);
                  break;
              case R.id.categories_button_yabanci_tarihi_kisiler:
                  Intent in17 = new Intent(getBaseContext(), SelectedCategory.class);
                  in17.putExtra("id", DBHelper.ID_TARIHI_KISILER_YABANCI);
                  startActivity(in17);
                  break;
              case R.id.categories_button_yerli_tarihi_kisiler:
                  Intent in18 = new Intent(getBaseContext(), SelectedCategory.class);
                  in18.putExtra("id", DBHelper.ID_TARIHI_KISILER_YERLI);
                  startActivity(in18);
                  break;
              case R.id.categories_button_yabanci_tarihi_mekanlar:
                  Intent in19 = new Intent(getBaseContext(), SelectedCategory.class);
                  in19.putExtra("id", DBHelper.ID_TARIHI_MEKANLAR_YABANCI);
                  startActivity(in19);
                  break;
              case R.id.categories_button_yerli_tarihi_mekanlar:
                  Intent in20 = new Intent(getBaseContext(), SelectedCategory.class);
                  in20.putExtra("id", DBHelper.ID_TARIHI_MEKANLAR_YERLI);
                  startActivity(in20);
                  break;
              case R.id.categories_button_ulkeler:
                  Intent in21 = new Intent(getBaseContext(), SelectedCategory.class);
                  in21.putExtra("id", DBHelper.ID_ULKELER);
                  startActivity(in21);
                  break;
              case R.id.categories_button_unlu_sehirler:
                  Intent in22 = new Intent(getBaseContext(), SelectedCategory.class);
                  in22.putExtra("id", DBHelper.ID_UNLU_SEHIRLER);
                  startActivity(in22);
                  break;
              case R.id.categories_button_unluler:
                  Intent in23 = new Intent(getBaseContext(), SelectedCategory.class);
                  in23.putExtra("id", DBHelper.ID_UNLULER);
                  startActivity(in23);
                  break;
              case R.id.categories_button_yemekler:
                  Intent in24 = new Intent(getBaseContext(), SelectedCategory.class);
                  in24.putExtra("id", DBHelper.ID_YEMEKLER);
                  startActivity(in24);
                  break;
              case R.id.categories_button_cizgi_film_kahraman:
                  Intent in25 = new Intent(getBaseContext(), SelectedCategory.class);
                  in25.putExtra("id", DBHelper.ID_CIZGI_FILM_KAHRAMANLARI);
                  startActivity(in25);
                  break;
              case R.id.categories_button_karisik:
                  Intent in26 = new Intent(getBaseContext(), SelectedCategory.class);
                  in26.putExtra("id", DBHelper.ID_KARISIK);
                  startActivity(in26);
                  break;
              }
  
          }
      };
  }
  </code></pre>