[android-developers] Re: ListActivity, Cursor, and CursorAdapter

2011-04-07 Thread Mike Bear
Please take the table in DB for example: ID Player_Name Score 1 Jim 10 2 Bill 20 3 Bob 15 4 Mike 9 In the ListActivity, I want it shows like: Rank Player_Name Score 1 Bill 20 2 Bob 15 3 Jim 10 4 Mike 9 On Thu, Apr 7, 2011 at 2:48 PM, android.xi...@gmail.com

Re: [android-developers] Re: ListActivity, Cursor, and CursorAdapter

2011-04-07 Thread Mike Bear
At last, I used the simplest way, extract all the data out of via the cursor, and then prepare the data list for my listactivity. It works. On Fri, Apr 8, 2011 at 1:51 AM, Nadeem Hasan nha...@nadmm.com wrote: Use the cursor position by calling Cursor.getPosition(). -- You received this

[android-developers] Re: How to pass configuration parameters to custom views during construction

2011-04-06 Thread Mike Bear
Currently, I use this way, and it seems works. But there are shall be some better way, I think. public MyView(Context context, AttributeSet attrs) { super(context, attrs); //Get the value from Activity this.mInt = ((MyActivity)context).getMyInt()); } On Wed, Apr 6, 2011 at 1:48 PM,

Re: [android-developers] Re: How to pass configuration parameters to custom views during construction

2011-04-06 Thread Mike Bear
I defined the XML file and attributes, and can read the values from the attributes. But still there is another issue, How can I set the values in MyActivity? Thanks, Mike On Wed, Apr 6, 2011 at 2:37 PM, Zsolt Vasvari zvasv...@gmail.com wrote: Use custom attributes in the layout XML. You

Re: [android-developers] Re: How to pass configuration parameters to custom views during construction

2011-04-06 Thread Mike Bear
I don't like it, either. On Wed, Apr 6, 2011 at 2:37 PM, Zsolt Vasvari zvasv...@gmail.com wrote: public MyView(Context context, AttributeSet attrs) { super(context, attrs); //Get the value from Activity this.mInt = ((MyActivity)context).getMyInt()); } That's just terrible, sorry.

Re: [android-developers] Re: How to pass configuration parameters to custom views during construction

2011-04-06 Thread Mike Bear
, before the view is constructed. On Wed, Apr 6, 2011 at 5:07 PM, Kumar Bibek coomar@gmail.com wrote: Expose methods in your custom view that activities can call directly. Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Wed, Apr 6, 2011 at 2:35 PM, Mike Bear

Re: [android-developers] Re: How to pass configuration parameters to custom views during construction

2011-04-06 Thread Mike Bear
of a situation where you would want to do that. Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Wed, Apr 6, 2011 at 2:47 PM, Mike Bear android.xi...@gmail.com wrote: I want to set the value before the constructor MyView, so then the view instance is not ready yet. My plan

Re: [android-developers] Re: How to pass configuration parameters to custom views during construction

2011-04-06 Thread Mike Bear
06.04.2011 13:47, Mike Bear пишет: The scenario is like the following: 1. MyView is one of the component in MyActivity. 2. MyActivity is created from other activity, with an intent containing all the information for the activity, including the parameter for MyView. 3. We shall pass the parameter

Re: [android-developers] How can I draw nice connections between two points in Android?

2011-03-30 Thread Mike Bear
if you just had lines it would be more light weight. What's the purpose of it though, that might help give a better answer (or point you in a better direction perhaps). Kris On Wed, Mar 30, 2011 at 12:55 AM, Mike Bear android.xi...@gmail.comwrote: Hi Kris and all, As my understanding

Re: [android-developers] Re: Suggestions on best way to draw a laser in a 2d game

2011-03-29 Thread Mike Bear
Sounds interesting about your implementation. How many lines of code do you wrote for the C# lightning? How about it compared to the bitmap version? Thanks, On Fri, Feb 4, 2011 at 11:41 PM, niko20 nikolatesl...@yahoo.com wrote: Peter's idea sounds like a good one to start with to try and see

Re: [android-developers] How can I draw nice connections between two points in Android?

2011-03-29 Thread Mike Bear
Hi Kris and all, As my understanding, there are maybe two possible solutions: 1. draw points by points, to render a connection like lightning (or river) between the two points p1 and p2. 2. draw image to between the two points; in the image, we can draw what we want. Do you think both solutions