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

  • Home
  • SEARCH
  • 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 9184891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:09:44+00:00 2026-06-17T19:09:44+00:00

My error is as shown below 01-24 10:07:51.053: E/AndroidRuntime(809): FATAL EXCEPTION: main 01-24 10:07:51.053:

  • 0

My error is as shown below

 01-24 10:07:51.053: E/AndroidRuntime(809): FATAL EXCEPTION: main
01-24 10:07:51.053: E/AndroidRuntime(809): java.lang.IllegalStateException: Could not find a method res/drawable-hdpi/textfield_activated_holo_light.9.png(View) in the activity class com.example.iolcalci.Selection for onClick handler on view class android.widget.EditText with id 'k1_editText'
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.view.View$1.onClick(View.java:3584)
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.view.View.performClick(View.java:4202)
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.view.View$PerformClick.run(View.java:17340)
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.os.Handler.handleCallback(Handler.java:725)
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.os.Handler.dispatchMessage(Handler.java:92)
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.os.Looper.loop(Looper.java:137)
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.app.ActivityThread.main(ActivityThread.java:5039)
01-24 10:07:51.053: E/AndroidRuntime(809):  at java.lang.reflect.Method.invokeNative(Native Method)
01-24 10:07:51.053: E/AndroidRuntime(809):  at java.lang.reflect.Method.invoke(Method.java:511)
01-24 10:07:51.053: E/AndroidRuntime(809):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-24 10:07:51.053: E/AndroidRuntime(809):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-24 10:07:51.053: E/AndroidRuntime(809):  at dalvik.system.NativeStart.main(Native Method)
01-24 10:07:51.053: E/AndroidRuntime(809): Caused by: java.lang.NoSuchMethodException: res/drawable-hdpi/textfield_activated_holo_light.9.png [class android.view.View]
01-24 10:07:51.053: E/AndroidRuntime(809):  at java.lang.Class.getConstructorOrMethod(Class.java:460)
01-24 10:07:51.053: E/AndroidRuntime(809):  at java.lang.Class.getMethod(Class.java:915)
01-24 10:07:51.053: E/AndroidRuntime(809):  at android.view.View$1.onClick(View.java:3577)
01-24 10:07:51.053: E/AndroidRuntime(809):  ... 11 more

please help me i am a beginner in android developing.I dont think there is error in the code.

my code goes here

public class Selection extends Activity {
    private EditText k1_e,k2_e,al_e,alconst_e,dr_e;
    private float k1,k2,al,al_const,dr,Avg_k,IOLPower;
    private Spinner spin;
    private Button result;
    private int spinSelected=-1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.selective);
}

    @Override
    protected void onStart() {
        // TODO Auto-generated method stub
        super.onStart();
        this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
        spin=(Spinner)findViewById(R.id.formulae);
        spin.setOnItemSelectedListener(new OnItemSelectedListener() {

            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int pos,
                    long id) {
                // TODO Auto-generated method stub
                spinSelected=pos;

            }

            @Override
            public void onNothingSelected(AdapterView<?> arg0) {
                // TODO Auto-generated method stub
                spinSelected=-1;
            }
        });
        result=(Button)findViewById(R.id.result);
        result.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                int flag = 0;
                String op="INVALID INPUT";
                dr_e=(EditText)findViewById(R.id.dr_editText);
                k1_e=(EditText)findViewById(R.id.k1_editText);
                k2_e=(EditText)findViewById(R.id.k2_editText);
                al_e=(EditText)findViewById(R.id.al_editText);
                alconst_e=(EditText)findViewById(R.id.al_const_editText);
                k1_e.isClickable();
                k2_e.isClickable();
                al_e.isClickable();
                alconst_e.isClickable();
                if(dr_e.getText().toString().length()==0|k1_e.getText().toString().length()==0|k2_e.getText().toString().length()==0|al_e.getText().toString().length()==0|alconst_e.getText().toString().length()==0){
                    flag=1;
                }else{

                dr=Float.parseFloat(dr_e.getText().toString());
                k1=Float.parseFloat(k1_e.getText().toString());
                k2=Float.parseFloat(k2_e.getText().toString());
                al=Float.parseFloat(al_e.getText().toString());
                al_const=Float.parseFloat(alconst_e.getText().toString()); 
                }

                Avg_k=(k1+k2)/2;
                if(spinSelected==0){
                IOLPower=Srkt();    
                Intent iSrkt=new Intent(Selection.this,Srkt.class);
                if(flag!=1){
                iSrkt.putExtra("RESULT", IOLPower);
                }else{
                    iSrkt.putExtra("FLAG", flag);
                    iSrkt.putExtra("RESULT", op);
                }
                startActivity(iSrkt);
            }else if(spinSelected==1){
                IOLPower=Binkhorst();
                Intent iBinkhorst=new Intent(Selection.this,Binkhorst.class);
                if(flag!=1){
                    iBinkhorst.putExtra("RESULT", IOLPower);
                }else{
                    iBinkhorst.putExtra("FLAG", flag);
                    iBinkhorst.putExtra("RESULT", op);
                }
                startActivity(iBinkhorst);
            }else if(spinSelected==2){
            IOLPower=Srk2();
            Intent iSrk2=new Intent(Selection.this,Srk2.class);
            if(flag!=1){
                iSrk2.putExtra("RESULT", IOLPower);
            }else{
                iSrk2.putExtra("FLAG", flag);
                iSrk2.putExtra("RESULT", op);
            }
            startActivity(iSrk2);
            }else{
                IOLPower=Holladay();
                Intent iHolladay=new Intent(Selection.this,Holladay.class);
                if(flag!=1){
                    iHolladay.putExtra("RESULT", IOLPower);
                }else{
                    iHolladay.putExtra("FLAG", flag);
                    iHolladay.putExtra("RESULT", op);
                }
                startActivity(iHolladay);
            }
            }
            });
    }
    public static float Round(float Rval, int Rpl) {
          float p = (float)Math.pow(10,Rpl);
          Rval = Rval * p;
          float tmp = Math.round(Rval);
          return (float)tmp/p;
          }
    public float Srkt(){
         float Rcor;
         float Lcor;
         float Crwdest;
         float Corneal_H;
         float Acd_Const;
         float Offset;
         float Acd_Est;
         float Na=(float) 1.336;
         float C2=(float) 0.3333;
         float C3;
         float C4;
         float C5;
         float C6;
         float C8;
         float C9;
         float Iolam;


         float Rcor1=(float)(337.5/Avg_k);Rcor=Round(Rcor1,2);

            if(al<=24.2){
                Lcor=al;
            }else{
                Lcor=(float) (-3.446+1.716*al-0.0237*(al*al));
            }Lcor=Round(Lcor,2);
            Crwdest=(float) (-5.41+0.58412*Lcor+0.098*Avg_k);Crwdest=Round(Crwdest,2);
            Corneal_H=(float) (Rcor-(Math.sqrt(Rcor*Rcor-Crwdest*Crwdest/4)));Corneal_H=Round(Corneal_H,2);
            Acd_Const=(float) (0.62467*al_const-68.747);
            Offset=(float) (Acd_Const-3.336);Offset=Round(Offset,2);
            Acd_Est=(Corneal_H+Offset); float Acd_Est1=Round(Acd_Est,2);
            C3=(float) (0.97971*al+0.65696);C3=Round(C3,2);     
            C4=C3-Acd_Est1;C4=Round(C4,2);
            C5=(float) ((Na*Rcor)-(C2*Acd_Est)); C5=Round(C5, 2);
            C6=(float) ((Na*Rcor1)-(C2*C3));
            C8=(float) ((12*C6)+(C3*Rcor1));C8=Round(C8,2);
            C9=(float) ((12*C5)+(Acd_Est*Rcor1));C9=Round(C9,2);
            Iolam=(float) ((1336*(C6-(0.001*C8*dr)))/(C4*(C5-(0.001*dr*C9))));Iolam=Round(Iolam,2);
            Log.i("value",String.valueOf(Avg_k));
            Log.i("value",String.valueOf(Rcor));
            Log.i("value",String.valueOf(Lcor));
            Log.i("value",String.valueOf(Crwdest));
            Log.i("value",String.valueOf(Corneal_H));
            Log.i("value",String.valueOf(Acd_Const));
            Log.i("value",String.valueOf(Offset));
            Log.i("value",String.valueOf(Acd_Est));
            Log.i("value",String.valueOf(Na));
            Log.i("value",String.valueOf(C2));
            Log.i("value",String.valueOf(C3));
            Log.i("value",String.valueOf(C4));
            Log.i("value",String.valueOf(C5));
            Log.i("value",String.valueOf(C6));
            Log.i("value",String.valueOf(C8));
            Log.i("value",String.valueOf(C9));
            Log.i("value",String.valueOf(Iolam));
        return(Iolam);
    }
    public float Binkhorst(){
        float K1;
        float LB2;
        float ACDbnk;
        float xb;
        float yb;
        float em;

        K1=(float)(337.5/Avg_k);
        LB2=(float) (al+0.1984);
        if(LB2>=26){
            ACDbnk=(float) (((0.58357*al_const)-63.896)*1.1087);
        }else{
            ACDbnk=(float) (((0.58357*al_const)-63.896)*LB2/23.45);
        }
        xb=(float) (1336*((1.336*K1-0.3333*LB2)-0.001*dr*(16.032*K1-4*LB2+LB2*K1)));
        yb=(float) ((LB2-ACDbnk)*(1.336*K1-0.3333*ACDbnk-0.001*dr*(16.032*K1-4*ACDbnk+ACDbnk*K1)));
        em=xb/yb;em=Round(em,2);
        return(em);
    }
    public float Srk2(){
        float X25 = 0;
        float Avg_k=(k1+k2)/2;
        if(al<20.0){
            X25=al_const+3;
        }else if((al>=20.0)&&(al<21.0)){
            X25=al_const+2;
        }else if((al>=21.0)&&(al<22.0)){
            X25=al_const+1;
        }else if((al>=22.0)&&(al<24.5)){
            X25=al_const;
        }else if(al>=24.5){
            X25=(float) (al_const-(0.5));
        }else{
            Toast.makeText(getApplicationContext(), "Please enter valid AL value", Toast.LENGTH_SHORT).show();
        }
        float SRK2 = (float) (X25-(0.9*Avg_k+2.5*al));
        return(SRK2);
    }
    public float Holladay(){
        float K;
        float Lhol;
        float SF;
        float Rag;
        float AGx;
        float AG;
        float ACDH;
        float CAhol;
        float xh;
        float yh;

        float K1=(float)(337.5/Avg_k);K=Round(K1,2);
        Lhol=(float) (al+0.2);
        SF=(float) ((0.5663*al_const)-65.6);
        if(K<7){
            Rag=7;
        }else{
            Rag=K;
        }
        AGx=(float) (al*0.533);
        if(AGx>13.5){
             AG=(float) 13.5;
        }else{
            AG=AGx;
        }
        ACDH=(float) (0.56+Rag-(Math.sqrt(Rag*Rag-AG*AG/4)));
        CAhol=ACDH+SF;
        xh=(float) (1336*((1.336*K1-0.3333*Lhol)-0.001*dr*(16.032*K1-4*Lhol+Lhol*K1)));
        yh=(float) ((Lhol-CAhol)*(1.336*K1-0.3333*CAhol-0.001*dr*(16.032*K1-4*CAhol+CAhol*K1)));
        float em=xh/yh;em=Round(em,2);
        return(em);
    }
    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        dr_e=(EditText)findViewById(R.id.dr_editText);
        k1_e=(EditText)findViewById(R.id.k1_editText);
        k2_e=(EditText)findViewById(R.id.k2_editText);
        al_e=(EditText)findViewById(R.id.al_editText);
        alconst_e=(EditText)findViewById(R.id.al_const_editText);
        dr_e.setText(null);
        k1_e.setText(null);
        k2_e.setText(null);
        al_e.setText(null);
        alconst_e.setText(null);
        dr_e.requestFocus();
    }

}

xml file goes here

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/black"
    android:orientation="vertical" 
    android:id="@+id/form_layout" xmlns:android="http://schemas.android.com/apk/res/android">

    <Spinner
        android:id="@+id/formulae"
        android:layout_width="400dp"
        android:layout_height="125dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:background="@color/LightSkyBlue"
        android:dropDownWidth="wrap_content"
        android:entries="@array/formulas"
        android:gravity="center"
        android:paddingLeft="0dp"
        android:textAlignment="center" />

    <EditText
        android:id="@+id/k1_editText"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/k1"
        android:layout_alignLeft="@+id/al_const_editText"
        android:layout_alignTop="@+id/k1"
        android:background="@color/black"
        android:ems="10"
        android:enabled="true"
        android:focusable="true"
        android:inputType="numberDecimal"
        android:textColor="@color/White"
        android:textSize="30sp"
        android:onClick="@drawable/textfield_activated_holo_light"
        android:visibility="visible" >
</EditText>

    <EditText
        android:id="@+id/k2_editText"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/k2"
        android:layout_alignLeft="@+id/k1_editText"
        android:layout_alignTop="@+id/k2"
        android:background="@color/black"
        android:ems="10"
        android:enabled="true"
        android:inputType="numberDecimal"
        android:onClick="@drawable/textfield_activated_holo_light"
        android:textSize="30sp"
        android:visibility="visible" >

    </EditText>

    <EditText
        android:id="@+id/al_editText"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/al"
        android:layout_alignLeft="@+id/al_const_editText"
        android:layout_alignTop="@+id/al"
        android:ems="10"
        android:enabled="true"
        android:inputType="numberDecimal"
        android:onClick="@drawable/textfield_activated_holo_light"
        android:textSize="30sp"
        android:visibility="visible" />

    <EditText
        android:id="@+id/al_const_editText"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/al_const"
        android:layout_alignTop="@+id/al_const"
        android:layout_marginLeft="21dp"
        android:layout_toRightOf="@+id/al_const"
        android:ems="10"
        android:enabled="true"
        android:inputType="numberDecimal"
        android:onClick="@drawable/textfield_activated_holo_light"
        android:textSize="30sp"
        android:visibility="visible" />

    <Button
        android:id="@+id/result"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="28dp"
        android:background="@color/LightSkyBlue"
        android:gravity="center"
        android:height="100dp"
        android:maxWidth="80dp"
        android:minHeight="60dp"
        android:paddingLeft="150dp"
        android:paddingRight="200dp"
        android:text="@string/Result"
        android:textSize="60sp" />

    <TextView
        android:id="@+id/al_const"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/result"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="89dp"
        android:layout_marginLeft="50dp"
        android:text="@string/Rx"
        android:textColor="@color/White"
        android:textSize="60sp" />

    <TextView
        android:id="@+id/k2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/al"
        android:layout_alignLeft="@+id/al_const"
        android:layout_marginBottom="126dp"
        android:layout_marginLeft="23dp"
        android:text="@string/K2"
        android:textColor="@color/White"
        android:textSize="60sp" />

    <TextView
        android:id="@+id/al"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/al_const"
        android:layout_alignRight="@+id/k2"
        android:layout_marginBottom="125dp"
        android:text="@string/AL"
        android:textColor="@color/White"
        android:textSize="60sp" />

    <TextView
        android:id="@+id/k1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/k2"
        android:layout_alignLeft="@+id/al"
        android:layout_marginBottom="97dp"
        android:text="@string/K1"
        android:textColor="@color/white"
        android:textSize="60sp" />

    <EditText
        android:id="@+id/dr_editText"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/k1_editText"
        android:layout_below="@+id/formulae"
        android:layout_marginTop="58dp"
        android:ems="10"
        android:inputType="numberSigned|numberDecimal"
        android:paddingTop="35dp"
        android:textColor="@color/White"
        android:textSize="30sp" />

    <TextView
        android:id="@id/dr"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/dr_editText"
        android:layout_alignLeft="@+id/k2"
        android:layout_alignTop="@+id/dr_editText"
        android:layout_toLeftOf="@+id/dr_editText"
        android:ems="10"
        android:paddingLeft="100dp"
        android:paddingTop="10dp"
        android:text="@string/dr"
        android:textColor="@color/White"
        android:textSize="50sp" />

</RelativeLayout>

i have textfield_activated_holo_light.9.png in drawable folder. but why am i getting this error?

  • 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-17T19:09:45+00:00Added an answer on June 17, 2026 at 7:09 pm

    Remove this from your xml(in EditText)

     android:onClick="@drawable/textfield_activated_holo_light"
    

    As far as highlighting an editext is concerned, you can do so like this:

    1) Define an xml file say mybackground.xml

    <?xml version="1.0" encoding="utf-8"?> 
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
      <item android:state_pressed="true"
       android:drawable="@drawable/textfield_activated_holo_light" /> <!-- pressed -->
      <item android:state_focused="true"
       android:drawable="@drawable/textfield_activated_holo_light" /> <!-- focused -->
      <item android:drawable="@drawable/default" /> <!-- default -->
    </selector>
    

    2) Copy this xml in drawable folder

    3) Set this xml as background for your editext in your xml file:

      <EditText
            android:id="@+id/k1_editText"
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/k1"
            android:layout_alignLeft="@+id/al_const_editText"
            android:layout_alignTop="@+id/k1"
            android:background="@drawable/mybackground"
            android:ems="10"
            android:enabled="true"
            android:focusable="true"
            android:inputType="numberDecimal"
            android:textColor="@color/White"
            android:textSize="30sp"            
            android:visibility="visible" >
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The error as shown on the Noir error page: java.io.FileNotFoundException: Could not locate boundaries/lat_long__init.class
I am getting missing FROM clause error (shown below) I want to find the
I found that my DB.sql has error shown below, i did not process it
I get the error shown below (73TypeError) on a small background animation script when
I'm working on a GWT app, and keep getting the error shown below. I
I have a user who randomly gets a Script Error box (shown below) which
When I run cake bake all then I receive the error messages shown below.
I am using asp.net when loading image it gives me error as shown below.
When i am running my application as shown below error shows can you tell
// When I Run The Following Two Lines, I Get The Error Shown Below

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.