Sorry if it's a rudimentary question about Java as I'm coming from AS3 and
just basically starting out. Though I understand many concepts so far and
am writing my first app I'm trying to find best practices in some cases.
My question is the following.
In AS3, I could I address an instance of a
Why can't you do something like this:
public class A extends Activity
{
private RadiotButton _radio1;
protected void onCreate(Bundle bundle)
{
setContentView(your.layout.id)
_radio1 = findViewById(R.id.RadioButton01);
}
public void doSomethin
Oh, yeah I can do that. I can do manual check and target specifically radio
buttons I need with switch.
What I"m trying to do is target specific instances of RadioButton class in
this case based on my XML input I got from CMS and the choices users set in
it. For example what radio buttons will
In your base Activity class, add this:
protected RadioButton findRadioButtonById( int id ) {
return (RadioButton) findViewById( id );
}
This could of course throw an exception if the id does not represent a
RadioButton.
--
You received this message because you are subscribed to the Google
Well, you can use this to go from identifier-as-a-string to
identifier-as-a-number:
http://developer.android.com/reference/android/content/res/Resources.html#getIdentifier(java.lang.String,
java.lang.String, java.lang.String)
Another option is to specify tags for your buttons with
android:tag="bl
On Tuesday, March 20, 2012 9:25:54 AM UTC-7, Kostya Vasilyev wrote:
>
> Well, you can use this to go from identifier-as-a-string to
> identifier-as-a-number:
>
>
> http://developer.android.com/reference/android/content/res/Resources.html#getIdentifier(java.lang.String
> ,
> java.lang.String, java
All this is fine but OP needs to take a step back and ask himself why he
needs to use a string as an identifier? In Android, numeric resource ids
serve the same purpose and are already defined for you by the resource
compiler.
--
You received this message because you are subscribed to the Goog
>
> All this is fine but OP needs to take a step back and ask himself why he
> needs to use a string as an identifier? In Android, numeric resource ids
> serve the same purpose and are already defined for you by the resource
> compiler.
>
Agreed... What I would do is create a member variable for e
8 matches
Mail list logo