last day (14 days later) » 

13:24
0
A: Align row data considering decimal point in listview

PrasadYou need to format the text that is you are setting to the TextView for the 3 decimal points like below mwt = 0.2f; textView2 = (TextView)findViewById(R.id. textView2); textView2.setText(String.format("%.3f",mwt)); dwt = 0.1f; textView21 = (TextView)findViewById(R.id.textView21); t...

I did not get wat it wil do exactly ?..,i can have data like 12344.55666,2445.5555..,just that decimal point should come one below other..,this wil work ?
If you fix the decimal points to some fixed count it will work.Otherwise you need to programmatically add the spaces based on the highest number of decimal points
I have fixed three digits after decimal for all m.wt,d.wt and cs.wt..,how can it be handled now?
We put the gravity as end, so the text will align from end. We are fixing the text to 3 decimal points for all the text views which will give you required output
But for all the text views in the row should be same gravity. So that it will look gud
so i can use snippet has it is ?..,mwt=0.2f and dwt=0.1f ?
13:24
Yes you can
if you need any help please let me know
let me try
i shld put gravity end/
?
@Prasad
with no marginleft ?
yes worked out..,what if the data is not going to end always with three numbers after decimal ?
@Prasad
how can i write if else conditions for this
if you format the text for 3 decimal points it definitely contains 3 values after .
13:41
i mean if get data like 23.465,2.45,3.5 from server then?
java.util.IllegalFormatConversionException: %f can't format java.lang.String arguments
i will get this error els
%f means it will format for the float values..first you need to convert the string to float and then use same
currently i am getting data like 3.4,5.6 ,0.1
its float only
but not with three digits at end
then how can you get string format exception
with out using string
once check
ok
can we convert string to float n use?
some one has changed d datatype to string
13:58
Float.parseFloat(str)
ok let me try again
ok
if you pass string as empty or null also you will get the exception
so you need add one condition before you are formatting
if(!TextUtils.isEmpty(your_string)) {
Float.parseFloat(str);
}
its appending 0 at the end
no probs rite
if data is jst 4.5,then it wil be 4.500
yes
no prob
ok dane
thanks a lot :)
i am actually very new to this android..,thanks for ur guidance
i have one more issue with alert sometimes it throughs null poointer
@Override
public void onPause() {
    super.onPause();
    if (alert != null) {
        alert.dismiss();
     //   alert = null;
    }
}
alert.dismiss
even though i hv null check this dismiss throughs
14:23
can i have total class?
add one more condition
as alert.isShowing()
i think that is not issue
wait i i wil share

last day (14 days later) »