Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9216895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:31:00+00:00 2026-06-18T02:31:00+00:00

i am getting an exception in higher android versions(>=4.0) this is my Favourites.java :

  • 0

i am getting an exception in higher android versions(>=4.0)

this is my Favourites.java :

package com.SCHOOLinSITES.SiS.Connect;




import java.util.ArrayList;
import java.util.List;



import android.R.color;
import android.app.Activity;
import android.content.Intent;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;





public class Favorites extends Activity implements OnItemClickListener {
    /** Called when the activity is first created. */
    /**GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] {Color.RED,Color.GREEN});
    View title = getWindow().findViewById(android.R.id.title);
    View titleBar = (View) title.getParent();
    titleBar.setBackgroundDrawable(gd);**/

    int b;
    ArrayList<Item> items = new ArrayList<Item>();
    String[]   aaaa,aaaa1;
    List<String> list1=new ArrayList<String>();
    List<String> dlist=new ArrayList<String>();
    List<String> slist=new ArrayList<String>();
    List<String> did=new ArrayList<String>();
    List<String> web=new ArrayList<String>();
    List<String> sid=new ArrayList<String>();
    List<String> sweb=new ArrayList<String>();
    List<String> clist=new ArrayList<String>();
    List<String> cid=new ArrayList<String>();
    List<String> cweb=new ArrayList<String>();
    ListView l;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.main1);
       // setTitle("My Favorites");
       // setTitleColor(Color.argb(1,88,0,4));
      // setTitleColor(Color.parseColor("#580004"));
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);
       TextView t=(TextView)findViewById(R.id.myTitle);
       t.setText("My Favorites");


       //       SQLiteDatabase db=null;
//       String[] ar=null;
//       DBHelper op=new DBHelper(this,"pc", null, 1);
//       db=op.getReadableDatabase();
//       Cursor cursor= db.rawQuery("SELECT name FROM SCHOOLinSITES", null);
//       while (cursor.moveToNext()) {
//         String name=cursor.getString(cursor.getColumnIndex("name"));
//         String[] split=name.split(",");
//       if(split.length==4)
//       {
//          dlist.add(split[0]+","+split[1]);
//          did.add(split[2]);
//          web.add(split[3]);
//          
//       }
//       else{
//          
//          slist.add(split[0]+","+split[1]+","+split[2]);
//          sid.add(split[3]);
//          sweb.add(split[4]);
//          
//          
//       }
//      
//   }
//       db.close();
//       cursor.close();
//       if(dlist.size()>0 || slist.size()>0){
//          ImageView img1=(ImageView)findViewById(R.id.imgst6);
//          ImageView img2=(ImageView)findViewById(R.id.imgst7);
//          TextView txt1=(TextView)findViewById(R.id.starttext);
//          TextView txt2=(TextView)findViewById(R.id.starttext1);
//          TextView txt3=(TextView)findViewById(R.id.starttext3);
//          TextView txt4=(TextView)findViewById(R.id.starttext4);
//          img1.setVisibility(View.GONE);
//          img2.setVisibility(View.GONE);
//          txt1.setVisibility(View.GONE);
//          txt2.setVisibility(View.GONE);
//          txt3.setVisibility(View.GONE);
//          txt4.setVisibility(View.GONE);
//       items.clear();
//       if(dlist.size()!=0)
//           items.add(new SectionItem("Districts"));
//       for(int i=0;i<dlist.size();i++)
//       {
//           items.add(new EntryItem(dlist.get(i), null));
//       }
//       if(slist.size()!=0)
//           items.add(new SectionItem("Schools"));
//       for(int i=0;i<slist.size();i++)
//       {
//           items.add(new EntryItem(slist.get(i), null));
//       }
//         l=(ListView)findViewById(R.id.list1);
//       l.setCacheColorHint(color.transparent);
//       l.requestFocus(0);
//       l.setScrollingCacheEnabled(false);
//       l.setBackgroundColor(color.transparent);
//       EntryAdapter adapter = new EntryAdapter(this, items);
//       l.setAdapter(adapter);
//       l.setOnItemClickListener(this);
//       for(int i=0;i<dlist.size()+1;i++)
//       {
//          if(i==0)
//          {
//              clist.add("");
//              cid.add("");
//              cweb.add("");
//          }
//          else{
//              clist.add(dlist.get(i-1));
//              cid.add(did.get(i-1));
//              cweb.add(web.get(i-1));
//              
//  }
//          
//       }
//       for(int i=0;i<slist.size()+1;i++)
//       {
//          if(i==0)
//          {
//              clist.add("");
//              cid.add("");
//              cweb.add("");
//          }
//          else{
//              clist.add(slist.get(i-1));
//              cid.add(sid.get(i-1));
//              cweb.add(sweb.get(i-1));
//              
//  }
//          
//       }
//       }
//       else{
//           items.clear();
//           l=(ListView)findViewById(R.id.list1);
//            l.setCacheColorHint(color.transparent);
//            l.requestFocus(0);
//            l.setScrollingCacheEnabled(false);
//            l.setBackgroundColor(color.transparent);
//            EntryAdapter adapter = new EntryAdapter(this, items);
//            l.setAdapter(adapter);
//            l.setOnItemClickListener(this);
//          ImageView img1=(ImageView)findViewById(R.id.imgst6);
//          ImageView img2=(ImageView)findViewById(R.id.imgst7);
//          TextView txt1=(TextView)findViewById(R.id.starttext);
//          TextView txt2=(TextView)findViewById(R.id.starttext1);
//          TextView txt3=(TextView)findViewById(R.id.starttext3);
//          TextView txt4=(TextView)findViewById(R.id.starttext4);
//          img1.setVisibility(View.VISIBLE);
//          img2.setVisibility(View.VISIBLE);
//          txt1.setVisibility(View.VISIBLE);
//          txt2.setVisibility(View.VISIBLE);
//          txt3.setVisibility(View.VISIBLE);
//          txt4.setVisibility(View.VISIBLE);
//       }

    }
    public void method1(View v)
    {
        Intent start=new Intent(this, Find.class);
        startActivity(start);
    }
    public void method2(View v)
    {


    }
    public void method3(View v)
    {

        Intent start=new Intent(this,Resources.class );
        startActivity(start);
    }
   public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) 
   {

        b=arg2;
        myClickHandler();
    }
      public void myClickHandler() {

            String[] split;
            split=clist.get(b).split(",");
            if(split.length==2){
            Intent gotoLIst=new Intent(this,District.class);
            gotoLIst.putExtra("name", clist.get(b));   
            gotoLIst.putExtra("did",cid.get(b));
            gotoLIst.putExtra("web", cweb.get(b));
            startActivity(gotoLIst);
            }
            else{
                 Intent gotoLIst=new Intent(this,schooldetails.class);
                gotoLIst.putExtra("name", clist.get(b));   
                gotoLIst.putExtra("did",cid.get(b));
                gotoLIst.putExtra("web", cweb.get(b));
                startActivity(gotoLIst);


            }


        }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        dlist.clear();
        slist.clear();
        sid.clear();
        did.clear();
        web.clear();
        sweb.clear();
        clist.clear();
        cid.clear();
        cweb.clear();
        list1.clear();
        SQLiteDatabase db=null;
        String[] ar=null;
        DBHelper op=new DBHelper(this,"pc", null, 1);
        db=op.getReadableDatabase();
        Cursor cursor= db.rawQuery("SELECT name FROM SCHOOLinSITES", null);
        while (cursor.moveToNext()) {
           String name=cursor.getString(cursor.getColumnIndex("name"));

           String[] split=name.split(",");
        if(split.length==4)
        {
            dlist.add(split[0]+","+split[1]);
            did.add(split[2]);
            web.add(split[3]);

        }
        else{

            slist.add(split[0]+","+split[1]+","+split[2]);
            sid.add(split[3]);
            sweb.add(split[4]);


        }

    }
        db.close();
        cursor.close();
        if(dlist.size()>0 || slist.size()>0){
            ImageView img1=(ImageView)findViewById(R.id.imgst6);
            ImageView img2=(ImageView)findViewById(R.id.imgst7);
            TextView txt1=(TextView)findViewById(R.id.starttext);
            //TextView txt2=(TextView)findViewById(R.id.starttext1);
            TextView txt3=(TextView)findViewById(R.id.starttext3);
            //TextView txt4=(TextView)findViewById(R.id.starttext4);
            img1.setVisibility(View.GONE);
            img2.setVisibility(View.GONE);
            txt1.setVisibility(View.GONE);
            //txt2.setVisibility(View.GONE);
            txt3.setVisibility(View.GONE);
            //txt4.setVisibility(View.GONE);

        items.clear();
        if(dlist.size()!=0)
             items.add(new SectionItem("Districts"));
        for(int i=0;i<dlist.size();i++)
        {
             items.add(new EntryItem(dlist.get(i), null));
        }
        if(slist.size()!=0)
             items.add(new SectionItem("Schools"));
        for(int i=0;i<slist.size();i++)
        {
             items.add(new EntryItem(slist.get(i), null));
        }
        l=(ListView)findViewById(R.id.list1);
        l.setCacheColorHint(color.transparent);
        l.requestFocus(0);
        l.setScrollingCacheEnabled(false);
        l.setBackgroundColor(color.transparent);
        EntryAdapter adapter = new EntryAdapter(this, items);
        l.setAdapter(adapter);
        l.setOnItemClickListener(this);

       if(dlist.size()>0){
        for(int i=0;i<dlist.size()+1;i++)
        {
            if(i==0)
            {
                clist.add("");
                cid.add("");
                cweb.add("");
            }
            else{
                clist.add(dlist.get(i-1));
                cid.add(did.get(i-1));
                cweb.add(web.get(i-1));

   }
        }
        }
       if(slist.size()>0){
        for(int i=0;i<slist.size()+1;i++)
        {
            if(i==0)
            {
                clist.add("");
                cid.add("");
                cweb.add("");
            }
            else{
                clist.add(slist.get(i-1));
                cid.add(sid.get(i-1));
                cweb.add(sweb.get(i-1));

   }

        }
       }
        }
else{
     items.clear();
     l=(ListView)findViewById(R.id.list1);
     l.setCacheColorHint(color.transparent);
     l.requestFocus(0);
     l.setScrollingCacheEnabled(false);
     l.setBackgroundColor(color.transparent);
     EntryAdapter adapter = new EntryAdapter(this, items);
     l.setAdapter(adapter);
     l.setOnItemClickListener(this);

            ImageView img1=(ImageView)findViewById(R.id.imgst6);
            ImageView img2=(ImageView)findViewById(R.id.imgst7);
            TextView txt1=(TextView)findViewById(R.id.starttext);
            //TextView txt2=(TextView)findViewById(R.id.starttext1);
            TextView txt3=(TextView)findViewById(R.id.starttext3);
            //TextView txt4=(TextView)findViewById(R.id.starttext4);
            img1.setVisibility(View.VISIBLE);
            img2.setVisibility(View.VISIBLE);
            txt1.setVisibility(View.VISIBLE);
            //txt2.setVisibility(View.VISIBLE);
            txt3.setVisibility(View.VISIBLE);
            //txt4.setVisibility(View.VISIBLE);
        }
    }
    public void Add(View v)
      {
            SQLiteDatabase db=null;
            DBHelper helper=new DBHelper(this,"pc",null,1);
            db=helper.getWritableDatabase();
            //db.delete("SCHOOLinSITES", null, null);
            Integer i=(Integer)v.getTag();
            String str= clist.get((Integer)v.getTag())+","+cid.get((Integer)v.getTag())+","+cweb.get((Integer)v.getTag());

            String whereClause ="name=?";

            db.delete("SCHOOLinSITES", whereClause, new String[]{str});
           db.close();
            onResume();
       }
}

when i tried to execute it on android 4.0 and higher versions i am getting the exception at setcontentview(r.layout.main1) .

Exception Details:

01-31 13:34:30.261: D/AndroidRuntime(689): Shutting down VM
01-31 13:34:30.261: W/dalvikvm(689): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-31 13:34:30.281: E/AndroidRuntime(689): FATAL EXCEPTION: main
01-31 13:34:30.281: E/AndroidRuntime(689): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.SCHOOLinSITES.SiS.Connect/com.SCHOOLinSITES.SiS.Connect.Favorites}: android.view.InflateException: Binary XML file line #5: Error inflating class <unknown>
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.os.Looper.loop(Looper.java:137)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.ActivityThread.main(ActivityThread.java:4424)
01-31 13:34:30.281: E/AndroidRuntime(689):  at java.lang.reflect.Method.invokeNative(Native Method)
01-31 13:34:30.281: E/AndroidRuntime(689):  at java.lang.reflect.Method.invoke(Method.java:511)
01-31 13:34:30.281: E/AndroidRuntime(689):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-31 13:34:30.281: E/AndroidRuntime(689):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-31 13:34:30.281: E/AndroidRuntime(689):  at dalvik.system.NativeStart.main(Native Method)
01-31 13:34:30.281: E/AndroidRuntime(689): Caused by: android.view.InflateException: Binary XML file line #5: Error inflating class <unknown>
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.createView(LayoutInflater.java:606)
01-31 13:34:30.281: E/AndroidRuntime(689):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-31 13:34:30.281: E/AndroidRuntime(689):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.Activity.setContentView(Activity.java:1835)
01-31 13:34:30.281: E/AndroidRuntime(689):  at com.SCHOOLinSITES.SiS.Connect.Favorites.onCreate(Favorites.java:57)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.Activity.performCreate(Activity.java:4465)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
01-31 13:34:30.281: E/AndroidRuntime(689):  ... 11 more
01-31 13:34:30.281: E/AndroidRuntime(689): Caused by: java.lang.reflect.InvocationTargetException
01-31 13:34:30.281: E/AndroidRuntime(689):  at java.lang.reflect.Constructor.constructNative(Native Method)
01-31 13:34:30.281: E/AndroidRuntime(689):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.LayoutInflater.createView(LayoutInflater.java:586)
01-31 13:34:30.281: E/AndroidRuntime(689):  ... 24 more
01-31 13:34:30.281: E/AndroidRuntime(689): Caused by: java.lang.OutOfMemoryError
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.Bitmap.nativeCreate(Native Method)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.content.res.Resources.loadDrawable(Resources.java:1935)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.View.<init>(View.java:2785)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.View.<init>(View.java:2722)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.view.ViewGroup.<init>(ViewGroup.java:379)
01-31 13:34:30.281: E/AndroidRuntime(689):  at android.widget.RelativeLayout.<init>(RelativeLayout.java:174)
01-31 13:34:30.281: E/AndroidRuntime(689):  ... 27 more
01-31 13:34:30.591: I/dalvikvm(689): threadid=3: reacting to signal 3
01-31 13:34:30.602: I/dalvikvm(689): Wrote stack traces to '/data/anr/traces.txt'
01-31 13:34:30.871: I/dalvikvm(689): threadid=3: reacting to signal 3
01-31 13:34:30.881: I/dalvikvm(689): Wrote stack traces to '/data/anr/traces.txt'

how can i solve the problem.

layoutfile:

<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="match_parent" android:id="@+id/relativeLayout1" >


 <RelativeLayout
        android:id="@+id/rel_bottom"
        android:layout_width="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_height="fill_parent"
        android:background="@drawable/mainbg" >

      <ListView  android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/list1" android:divider="@null"
android:dividerHeight="0dp" android:layout_alignParentLeft="true" android:paddingTop="15dp" android:paddingLeft="10dp" android:listSelector="@android:color/transparent"> </ListView>


        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:id="@+id/imgst6"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="30dp" android:background="@drawable/discticts" android:visibility="invisible"/>
       <TextView android:text="" android:onClick="method1" android:background="@drawable/search"
            android:clickable="true"  android:layout_width="wrap_content" android:id="@+id/starttext" android:visibility="invisible"
            android:layout_height="wrap_content"  android:layout_marginLeft="30dp" android:layout_below="@+id/imgst6" android:layout_marginTop="8dip" ></TextView>
<!--        <TextView android:text="Districts to add them to your Favorites" android:visibility="invisible" android:id="@+id/starttext1" android:layout_toRightOf="@+id/starttext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/imgst6" android:layout_marginTop="10dp" android:layout_marginLeft="5dp" android:textColor="#4D4D4D" android:textSize="12sp"></TextView>    -->
      <ImageView android:id="@+id/imgst7"  android:layout_width="wrap_content" android:visibility="invisible"
            android:layout_height="wrap_content"  android:layout_marginLeft="20dp" android:background="@drawable/schools" android:layout_below="@+id/starttext" android:layout_marginTop="10dp"></ImageView> 
      <TextView android:text="" android:onClick="method1" android:background="@drawable/search"
            android:clickable="true" android:visibility="invisible" android:layout_width="wrap_content" android:id="@+id/starttext3"
            android:layout_height="wrap_content"  android:layout_marginLeft="30dp" android:layout_below="@+id/imgst7" android:layout_marginTop="8dp" ></TextView>
<!--          <TextView android:text="Schools to add them to your Favorites" android:visibility="invisible" android:id="@+id/starttext4" android:layout_toRightOf="@+id/starttext3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/imgst7" android:layout_marginTop="10dp" android:layout_marginLeft="5dp" android:textColor="#4D4D4D" android:textSize="12sp"></TextView>    -->
</RelativeLayout>

 <RelativeLayout
        android:id="@+id/rel_bottom"
        android:layout_width="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_height="38dp"
        android:background="@drawable/bottom_bar" 
         android:paddingTop="5dp"
        >

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:background="@drawable/findbtn"
            android:id="@+id/img1"
            android:onClick="method1"
            android:clickable="true"
            android:layout_marginLeft="15dp"
            />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/resourcesbtn"
            android:layout_alignParentRight="true" android:onClick="method3"
             android:clickable="true"
            android:id="@+id/img2"
             android:layout_marginRight="15dp"
            />
           <ImageView
            android:id="@+id/img3"
            android:layout_width="40dp"
            android:layout_height="fill_parent"
            android:background="@drawable/icon"
            android:layout_centerInParent="true"
            android:visibility="invisible"
             />

    </RelativeLayout>
</RelativeLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:31:01+00:00Added an answer on June 18, 2026 at 2:31 am

    Throws a java.lang.OutOfMemoryError seems like you have a image in the layout that is too big and can’t be loaded on the device (or emulator) memory.

    Try to load a reduce version of the image (see android documentation) or post your layout for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 0 at com.ibm.icu.text.BreakDictionary.main(BreakDictionary.java:40) When I run/debug
This is the error I'm getting: Exception in thread main java.lang.Error: Unresolved compilation problem:
I am getting this exception when trying to run my PHP unit tests: Fatal
I am getting this exception: Collection was modified; enumeration operation may not execute. Directly
I am getting this exception while running any JSP on my tomcat5.5 server.Do I
I'm getting an exception from Cruise Control about not being able to connect to
What is the best practice way of getting Exception Transparency in Java when using
sql server 200 java 1.4 jboss 3 HI am getting exception message You cannot
I m getting exception as follow. Can anybody help me? 06-16 11:32:48.237: ERROR/AndroidRuntime(9223): java.lang.IllegalStateException:
I am getting Exception ThrottleService(79): problem reading network stats I don't know why this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.