Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid views, intents and layout problems
    primarykey
    data
    text
    <p>This is my first question, but ive been reading a lot of posts in here trying to get this right. But i just cant figure it out! So i'm hoping for assistance!</p> <p>I'm working on a Android application from where i enter a searchphrase in a autocomplete field. From here i would like the application to change to another layout xml file wich contains a listview of the results. When you click a item, it will go to yet another layout xml file.</p> <p>I got all the http posts and functions ready and working, but the thing that gives me a headace is the switching layout part. I been trying this so far:</p> <pre><code>setContentView(R.layout.newlayout); </code></pre> <p>Which works the way it should, it does change the layout but ofcourse with problems. If i press the backbutton on my phone, it just closes the app instead of going back to the previous layout. If i create a back button and set it's onclick to do a </p> <pre><code>setContentView(R.layout.previouslayout); </code></pre> <p>it goes back to the other layout, but it does not preserve the input data in the searchform, furthermore it does not reload the function for fetching the tags for the autocomplete. BIG problem!</p> <p>I'm guessing, that i have to use some kind of intent, or activity manager but i dont know how that works, and how would i send data along with the start of a new activity for my list view and product view?</p> <p>i hope you understand my question, and that you have the time to help me out.</p> <p>Best regards, and thanks. Jonas</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload