Re: [android-beginners] Re: custom listview add button above listeview

2010-07-31 Thread Mark Murphy
Sorry for the delay in responding.

On Fri, Jul 30, 2010 at 10:01 PM, calmchess  wrote:
> yes i think this does what i'm looking for do I need to write it from
> scratch or can i modify this code to suite my needs and use it?

It is licensed under the Apache License 2.0.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 9:25 PM, calmchess  wrote:
> and now i think we are at the root of my problem...how do
> i seperate the row from the container??

Well, your source code got cut off, so it is difficult to answer.

Somewhere, your Activity is calling setContentView().

Ideally, particularly for this case, setContentView() is passed a
resource ID pointing to a layout resource (e.g., R.layout.main). This
is the layout file that Nick demonstrated and Kostya referred to. That
layout for your whole activity needs to have your Button and your
ListView, wrapped in a RelativeLayout or LinearLayout.

Here is an example project, albeit one with a TextView instead of a
Button above the ListView:

http://github.com/commonsguy/cw-android/tree/master/Selection/List/

Here is a variation on that sample project, using a custom ListAdapter:

http://github.com/commonsguy/cw-android/tree/master/FancyLists/Recycling/

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 2.9 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 9:16 PM, calmchess  wrote:
> for the billionth time i'm useing  a CUSTOM LISTVIEW it inflates the
> xml

Which has nothing to do with anything.

< and getview gets called as many times as there is items in the
> array...if you put a button in the xml no matter what way you format
> the XML the button gets displayed multiple times not 1 time multiple
> times

The XML that was supplied is not for the *row*. It is for the
*container around the ListView*.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 2.9 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 8:55 PM, calmchess  wrote:
> I'm sorry i didn't try your code this isn't somthing that can be fixed
> by formatting XML

Yes, it can be. What you say you want is precisely what Nick and
Kostya have supplied in the answers.

> the button is always inside the  listview no matter
> what i do although yours came close to doing what i want.i want a
> button outside the listview and doesn't get highlighted by the list
> viewthankyou for your time.

Which is precisely what Nick and Kostya have supplied in the answers.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 2.9 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Nick Richardson
How can you still be having an issue?  I literally gave you the XML that you
need to accomplish what you're trying to do.

On Fri, Jul 30, 2010 at 8:24 AM, Kostya Vasilyev  wrote:

> Declare the button in the activity's layout xml, above the ListView.
>
> -- Kostya
>
> 30.07.2010 19:20, calmchess пишет:
>
>  I'm useing custom list view.which inflates the view..if you put a
>> button in the  XML it will put a button in each cell of the list view
>> i only want 1 button above the list view here is some more code to
>> make it clear.
>>
>> public class customlistview extends Activity implements
>> OnClickListener{
>>ListView l1;
>> private static class EfficientAdapter extends BaseAdapter  {
>>private LayoutInflater mInflater;
>>private ArrayList>  ret=null;
>>
>> public EfficientAdapter(Context context) {
>>  Sax sax1 = new Sax();
>>  try {
>>ret =  sax1.SaxIni();
>>} catch (Exception e) {
>>
>>e.printStackTrace();
>>}
>>
>>
>>   mInflater = LayoutInflater.from(context);
>>
>>
>>
>>  }
>>
>>
>>
>
>
> --
> Kostya Vasilev -- WiFi Manager + pretty widget --
> http://kmansoft.wordpress.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>



-- 
//Nick Richardson
//richardson.n...@gmail.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Kostya Vasilyev

Declare the button in the activity's layout xml, above the ListView.

-- Kostya

30.07.2010 19:20, calmchess пишет:

I'm useing custom list view.which inflates the view..if you put a
button in the  XML it will put a button in each cell of the list view
i only want 1 button above the list view here is some more code to
make it clear.

public class customlistview extends Activity implements
OnClickListener{
ListView l1;
 private static class EfficientAdapter extends BaseAdapter  {
private LayoutInflater mInflater;
private ArrayList>  ret=null;

 public EfficientAdapter(Context context) {
  Sax sax1 = new Sax();
  try {
ret =  sax1.SaxIni();
} catch (Exception e) {

e.printStackTrace();
}


   mInflater = LayoutInflater.from(context);



  }

   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en