• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps get the Double Value from String

joevj

Newbie
Hi All,

I am not an expert in Java and i'm rather new to Android development as well.

I am unable to extract the double value from a string... here is my code..

Code:
            String str;
            double amount;
            
            final EditText txtAmount = (EditText) findViewById(R.id.entryAmount);
            str = txtAmount.getText().toString();

            amount = (double)str;
//            amount =   parseDouble(str);
I tried to cast by (double) and tried parseDouble. None of my trials are working.

Can you help?

Regards
Joe


Is it a wrong location. Now I think I should posted a level below. But not able to remove !!
 
Back
Top Bottom