Fragments has some positive
Just calling the layout  it appears to render normally
orange selector colors, correct backgrounds etc..

My struggle now is  the layout has a button  how do I assign the onClickListener

This is called from the Main standard activity

                FragmentManager       fragmentManager        = 
getFragmentManager();
                FragmentTransaction   fragmentTransaction    = 
fragmentManager.beginTransaction();
                myMenu                fragment               = new myMenu();
                fragmentTransaction.add(R.id.menu2, fragment);
                fragmentTransaction.commit();

                Button  button;
                button = (Button) findViewById(R.id.visit_function);


myMenu  extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle 
savedInstanceState) {
        return inflater.inflate(R.layout.menu, container, false);
}

button is  null  and thus any button.  returns Null pointer errors
Also how would you fill in or read  text   setText and getText   from an  
EditText  also within the  layout opened by  myMenu's  onCreateView


thanks in advance



On Jun 16, 2011, at 6:25 AM, Droid wrote:

> 
> I think fragments can do that, but I have not got my head around them
> yet.
> Also, I have never changed 'part' of a layout just on its own without
> redrawing all of it. Sorry I am not much help.
> 
> 
> 
> On Jun 16, 2:46 am, New Developer <secur...@isscp.com> wrote:
>> create a simple layout.xml  with a Button and TextEdit
>> 
>> Then call that layout using  intent  and  then call the same layout using 
>> inflate
>> and see the difference.
>> 
>> Droid if you avoid inflate,  is there a way to call intent, but only use 
>> part of the screen
>> by that I mean I have a home page layout which has a framelayout as part of 
>> the screen
>> how can I use intent and fill just the framelayout with the new intent's 
>> layout ?
>> 
>> at present I only know that intent will change the whole screen.
>> 
>> So
>> Main layout.xml
>> --------------------------------------------
>> |  layout      |    layout 2                    |
>> |      1          |                                       |
>> |                  |-----------------------------|
>> |                  |  layout 3                      |
>> |                  |                                      |
>> --------------------------------------------
>> 
>> I just want to fill layout 3  with other layouts  using intent,  is this 
>> possible ??
>> 
>> thanks in advance
>> 
>> On Jun 15, 2011, at 8:00 PM, Dianne Hackborn wrote:
>> 
>> 
>> 
>>> My head is now exploding.  This discussion makes no sense at all. :p
>> 
>>> On Wed, Jun 15, 2011 at 3:34 PM, Droid <rod...@gmail.com> wrote:
>>> Yes, I noticed that inflate code has not so many attributes as in xml
>>> layout files.
>>> I generally avoid inflate for the reasons you stated. Not really sure
>>> what is going on behind the scenes.
>> 
>>> On Jun 15, 6:39 pm, New Developer <secur...@isscp.com> wrote:
>>>> Thanks
>> 
>>>> my OnCreate()  has nothing in it.
>>>> The only thing different is the method of calling the exact same  layout
>>>> 1) using intent        and        2) using inflate
>> 
>>>> The intent appears normal   the  the inflate appears transparent  even
>>>> when the button is clicked, or text is select the  original highlight 
>>>> color Orange is  gray  under  inflate.
>> 
>>>> Thanks
>> 
>>>> On Jun 15, 2011, at 10:47 AM, Marcin Orlowski wrote:
>> 
>>>>> You do not run the layout. You do not call it nor call it with the 
>>>>> intent. All you now comparing is bit nonsense as it is intent sent to 
>>>>> your application vs inflating xml file. Not much comparable. Check your 
>>>>> code in activity's onCreate() for anything extra you do there or check 
>>>>> your code around inflate() to see if you do not miss anything you do in 
>>>>> onCreate().
>> 
>>>>> Regards,
>>>>> Marcin Orlowski
>> 
>>>>> Tray Agenda - keep you daily schedule handy...
>>>>> Date In Tray - current date at glance...
>>>>> WebnetMobile on Facebook and Twitter
>> 
>>>>> On 15 June 2011 16:33, New Developer <secur...@isscp.com> wrote:
>>>>> I have a layout with a button and EditText  fields
>> 
>>>>> IF I call the layout using  intent
>>>>> intent.setClass(getApplicationContext(), eedsClientActivity.class...
>>>>> startActivity(....
>> 
>>>>> The Buttons have a light gray background neat black text
>>>>> and the EditText a white background
>> 
>>>>> IF I call the layout using  inflate
>>>>> inflate.inflate(R.layout.client_single,    parent);
>> 
>>>>> The Buttons have a dull gray background , Large white text
>>>>> and the EditText appear transparent, almost see through background 
>>>>> slightly grayish
>> 
>>>>> Why the Difference  it is the same .xml layout ??
>> 
>>>>> What additionally is called By intent  that inflate does not call ?
>> 
>>>>> thanks in advance
>> 
>>>>> --
>>>>> 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
>> 
>>> --
>>> 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
>> 
>>> --
>>> Dianne Hackborn
>>> Android framework engineer
>>> hack...@android.com
>> 
>>> Note: please don't send private questions to me, as I don't have time to 
>>> provide private support, and so won't reply to such e-mails.  All such 
>>> questions should be posted on public forums, where I and others can see and 
>>> answer them.
>> 
>>> --
>>> 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

-- 
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

Reply via email to