Re: [android-developers] How do I make my program does not appear in the Home screen or luncher after intallation? thanks!!!!!

2010-01-14 Thread Rui Wu
Don't set   in
 for your any Activity in AndroidManifest.xml

2010/1/14 何斌斌 

> HI All:
>
>Now, I think after install my application, then my app does not
> appear in the home screen or luncher?
> But I can start my app by other appliction. Can any one help me?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
BRs,
Rui
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: When the new activity starts, the data of previous activity is gone.

2010-01-01 Thread Rui Wu
Hi Pranav,
I didn't catch the point for your second problem. Do you want to pass the
value of edittext in first activity to second activity, then show the
strings in the edittext of second activiy. If so, you can try in the similar
way as the first problem.
BRs,
Rui


2010/1/1 android09 

> Hi Rui Wu,
>
> Thanks a lot. It works very good and perfectly as i want. Now, i know
> that where was my problem. Actually, i had not added this line/lines :
> "   mData.strFirstName = edFirstName.getEditableText().toString();".
> That's why i was not getting any result.
>
> Now, i got it. I have also one query. I have two activities. First
> activity consist on edittext and button whereas second activity
> consist only edittext. When i write in edittext of first activity and
> press a button of first activity than the edittext of second activity
> should get the same string. Actually, i want to get the email id from
> the first activity and also it should be automatically get in the
> edittext of second activity.
>
> If you have any idea about it, please tell me. Again thanks for help
> me out from this problem.
>
> Regards,
> --
> Pranav
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
BRs,
Rui

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: When the new activity starts, the data of previous activity is gone.

2010-01-01 Thread Rui Wu
Hi Pranav,
 I updated the code based on your previous mail.  Surely, it's only an
sample. You need make it more powerful & roubust.

2010/1/1 android09 

> Hi Rui Wu,
>
> Happy New Year!
>
> Thanks for reply me with the code. I tried for the current activity
> which holds the data while the second activity is started and get back
> to the current activity by pressing the previous button with using of
> your code. But every time i got the NullPointerException error. I can
> go on next activity but when i trying to back on the previous
> activity, i got an exception.
>
> Here, i have placed my code without added your code and i want that
> you just modified this code and reply me. So, can you help me to out
> from this problem?
>
> The "first.xml" file consist two edittext and one button & the
> "second.xml" file consist one button.   adds an edittext R.id.phonenumber
>

Person.java  (in the same package for the code convenience; can access
member variables directly)
public class Person implements Serializable{
  String fistName;
  String lastName;
  String phoneNumber;
 }


>
> FirstActivity.java
> --
>
> // Organised imports...
>
> public class FirstActivity extends Activity{
>
>private EditText edFirstName, edLastName;
>private Button btnNext;
>
>private Person mData;
>@Override
>public void onCreate(Bundle b){
>super.onCreate(b);
>setContentView(R.layout.first);
>Intent i = getIntent();
>mData = (Person)i.getSerializableExtra("DATA");
>if(mData == null) {
> mData = new Person();
>}

   edFirstName = (EditText)findViewById(R.id.editFirst);
>edLastName = (EditText)findViewById(R.id.editLast);
>edFirstName.setText(mData.fistName);
>edLastName.setText(mData.lastName);
>btnNext = (Button)findViewById(R.id.btnNext);
>btnNext.setOnClickListener(new View.OnClickListener(){
>
>@Override
>public void onClick(View v){
>  mData.fistName =
> edFirstName.getEditableText().toString();
>  mData.lastName =
> edLastName.getEditableText().toString();
>
   Intent intent = new
Intent(FirstActivity.this,
SecondActivity.class);
  intent.putExtra("DATA", mData);

>startActivity(intent);

   finish();

>}
>});
>}
> }
>
> SecondActivity.java
> ---
>
> // Organised imports...
>
> public class SecondActivity extends Activity{
>
>private Button btnPrev;
>private EditText mPhoneNumber;
>private Person mData;


>@Override
>public void onCreate(Bundle b){
>super.onCreate(b);
>setContentView(R.layout.second);
>mPhoneNumber = (EditText)findViewById(R.id.phonenumber);
> Intent i = getIntent();
> mData = (Person)i.getSerializableExtra("DATA");
> mPhoneNumber.setText(mData.phoneNumber);
>btnPrev = (Button)findViewById(R.id.btnPrevious);
>btnPrev.setOnClickListener(new View.OnClickListener(){
>
>@Override
>public void onClick(View v){
> mData.phoneNumber =
> mPhoneNumber.getEditableText().toString();
>
   Intent intent = new
Intent(SecondActivity.this,
FirstActivity.class);
   intent.putExtra("DATA", mData);
   startActivity(intent);
   finish();
   }
   });
   }
}

Thanks,

>  Regards,
> -
> Pranav
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
BRs,
Rui

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Doubt w.r.t content resolver

2009-12-31 Thread Rui Wu
All member functions in AppWidgetProvider have a Context type. I think you
can call Context's getContentResolver() to get an content resolver intance.




2009/12/31 deeMurthy 

> Hi
>
> Is it possible to access the content resolver methods in a class
> extending from AppWidgetProvider class? Have been trying to do it with
> no luck so far. Please help.
>
> Many Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
BRs,
Rui

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] tab index issue with soft keyboard

2009-12-31 Thread Rui Wu
*1. add android:imeOptions="actionNext" for all the EditText in layout xml *
*2. For your 2 horizontal edittext d/e, set OnEditorActionListener for them;
*

 *EditText et = (EditText) this.findViewById(...);
 et.setOnEditorActionListener( new OnEditorActionListener() {*
* **public boolean onEditorAction(TextView v, int actionId,KeyEvent
event) {
 switch(actionId) {
 **case EditorInfo.IME_ACTION_NEXT:*
*
 TextView v1 =
(TextView)v.focusSearch(View.FOCUS_RIGHT);
  if (v1 != null) {
   if (!v1.requestFocus(View.FOCUS_RIGHT)) {
   throw new IllegalStateException("unfocucsable
view.");//shouldn't get here for your layout
   }
  } else {
   v1 = (TextView) v.focusSearch(View.FOCUS_DOWN);
   if(v1 != null) {
   if(!v1.requestFocus(View.FOCUS_DOWN)) {*
*throw new
IllegalStateException("unfocucsable view..."); //should get here for your
layout
   }
  }
 }
 break;
 **default:*
*
 v.onEditorAction(actionId);
 break;
 }
 return true;
}*
*} );

*
*Of course, you can have more than 2 edittexts in a line. Also you can
override the implementation as per the actual layout.*

2010/1/1 csyperski 


> Is it possible when using imeOptions="actionNext" to make the focus go
> to the next field from left to right instead of just vertical.  For
> example is I have a layout like
>
> EditText - A
> EditText - b
> EditText - c
> EditText - d | EditText - e
> EditText - f
>
> The order seems to go, if using the next button on the soft keyboard:
> A, B, C, D, F, but I want A, B, C, D, E, F. Is there a way to make it
> from left to right, then top to bottom, instead of just top to bottom?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: When the new activity starts, the data of previous activity is gone.

2009-12-31 Thread Rui Wu
Hi Pranav,
The way in the previous mail has an issue: if user inputs sth. in Current
activiy named Activity2, then Presses "Prev", the previous Acitivy named
Activity1 does keep the inputed contents in UI, however when user
presses "Next" here to go to Activity2, Activity2 will not keep the data
inputed by user.

Another solution: Construct a Class for your registration info i.e. Person
which implements Serializable interface.

1. For each activiy,  implements the 2 buttons' logic like this:
 next.setOnClickListener(new OnClickListener(){
   public void onClick(View v) {
update person according to the cotents inputed by user
Intent i = new Intent();
i.setClassName(the name of the next activity.);
i.putExtra("Person", person);... //to pass this activity's data
to next
startActivity(i);
finish();
 }});

 previous.setOnClickListener(new OnClickListener(){
   public void onClick(View v) {
   update person according to the contents inputed by user
   Intent i = new Intent();
i.setClassName(the name of the previous activity.);
i.putExtra("Person", person);... //to pass this activity's data
to next
startActivity(i);
finsh();
 }});
 Of course, special logic is needed for the first activity's Back button &
the last activity's Next button;

2. Add below code in OnCreate() :

Intent i = getIntent();
person = (Person)i.getSerializableExtra("Person");
if(person != null) {
update the editable ui controls according to the value of person's
member variables
}  else {
person = new Person();   // this will only happen in the first activiy
}

3.  For the back key handle, use the same logic as Prev button to
set onKeyListener for the activiy.

BRs,
Rui

2010/1/1 Rui Wu 


> Hi Pranav,
> I guess you implemented your logic like this:
>
> Button previous = (Button) findViewById(.);
> previous.setOnClickListener(new OnClickListener(){
>public void onClick(View v) {
> Intent i = new Intent();
> i.setClassName(the name of the previous activiy.);
> startActivity(i);
>  }});
>
>
> Try the below way:
> Button next = (Button) findViewByid(.);
>  next.setOnClickListener(new OnClickListener(){
>public void onClick(View v) {
> Intent i = new Intent();
> i.setClassName(the name of the next activity.);
> i.putExtra();... //to pass this activity's data to next
> startActivity(i);
>  }});
>
>  Button previous = (Button) findViewById(.);
> previous.setOnClickListener(new OnClickListener(){
>public void onClick(View v) {
> finish();
>  }});
>
> What you need to do is passing the current activity's data to next
> Activity;  When you press the Prev button, you will find Android keeps
> the inputed strings  in the EditText and other editable views
> automatically...
>
> Hope this can help you.
>
> 2009/12/31 android09 
>
>
>> Hi Neilz,
>>
>> Thank you for reply me with the proper and useful idea. I tried to
>> hold the first activity data but it gives error while loading the
>> data. It is not allows me to get data back.
>>
>> Can you understand me by the code? How can i hold the first activity's
>> data when i start another activity and get back to previous. I also
>> tried with the onPause() and onResume() methods. How can i do that
>> with the code? Please help me.
>>
>> Thank you.
>> Regards,
>> ---
>> Pranav
>>
>>   --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Numeric Password in EditText

2009-12-31 Thread Rui Wu
EditText et = (EditText) findViewById(..);
et.setInputType(InputType.TYPE_CLASS_NUMBER);
et.setTransformationMethod(PasswordTransformationMethod.getInstance());
Don't reverse the sequence of the above 2 calls.

You can check the TextView.java to see how Android judges whether the
EditText is password-mode if you are interested.
2009/12/31 csyperski 

> Does anyone know how to do a EditText that should have hidden input,
> but also be numeric?  I tried using:
>
> Input Type = textPassword|number
>
> But this doesn't seem to work?  I know it is easy to do with the
> deprecated xml properties, but I want to stay away from them.
>
> Thanks in advance for any help you can provide!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: When the new activity starts, the data of previous activity is gone.

2009-12-31 Thread Rui Wu
Hi Pranav,
I guess you implemented your logic like this:

Button previous = (Button) findViewById(.);
previous.setOnClickListener(new OnClickListener(){
   public void onClick(View v) {
Intent i = new Intent();
i.setClassName(the name of the previous activiy.);
startActivity(i);
 }});


Try the below way:
Button next = (Button) findViewByid(.);
 next.setOnClickListener(new OnClickListener(){
   public void onClick(View v) {
Intent i = new Intent();
i.setClassName(the name of the next activity.);
i.putExtra();... //to pass this activity's data to next
startActivity(i);
 }});

 Button previous = (Button) findViewById(.);
previous.setOnClickListener(new OnClickListener(){
   public void onClick(View v) {
finish();
 }});

What you need to do is passing the current activity's data to next
Activity;  When you press the Prev button, you will find Android keeps
the inputed strings  in the EditText and other editable views
automatically...
Hope this can help you.

2009/12/31 android09 

> Hi Neilz,
>
> Thank you for reply me with the proper and useful idea. I tried to
> hold the first activity data but it gives error while loading the
> data. It is not allows me to get data back.
>
> Can you understand me by the code? How can i hold the first activity's
> data when i start another activity and get back to previous. I also
> tried with the onPause() and onResume() methods. How can i do that
> with the code? Please help me.
>
> Thank you.
> Regards,
> ---
> Pranav
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en