manuakasam
Lurker
Hello everyone,
I'm new to android development (java-dev, too) and got stuck with my first problem:
What my app does is the following:
- it reads a local xml file (it exists)
- from that xml file it builds a list
- with every xml-item there's a local file attached (if exists)
- on list-click the files are opened
The problem is what i'd like to happen on program start:
- start the program
- check for existing xml file if not download (works)
- xml-file to old -> showDialog(0);
-> inside dialog choose (update now or later)
- AFTER THAT
- render the list
- AFTER THAT
- check for each list item if a local file exists
- at the end of that showDialog(1) (download missing files yes/no)?
THe way i've done it - which is obviously wrong - is like that:
Because what happens is the following:
- the program starts
- dialog_download_documents is shown
- the list is shown
- dialog_download_xml_file is shown
All at the same time, goign by the way "I THINK" this is not wanted though.
So far i understand that there is no "wait for user input" in android. What i don't understand however is: "How do other Programs handle such a task when starting the app"?
Any links with the information i need - or even the topics i should look myself into - are greatly appreciated!
thanks in advance
/sam
I'm new to android development (java-dev, too) and got stuck with my first problem:
What my app does is the following:
- it reads a local xml file (it exists)
- from that xml file it builds a list
- with every xml-item there's a local file attached (if exists)
- on list-click the files are opened
The problem is what i'd like to happen on program start:
- start the program
- check for existing xml file if not download (works)
- xml-file to old -> showDialog(0);
-> inside dialog choose (update now or later)
- AFTER THAT
- render the list
- AFTER THAT
- check for each list item if a local file exists
- at the end of that showDialog(1) (download missing files yes/no)?
THe way i've done it - which is obviously wrong - is like that:
Code:
public void onCreate(Bundle savedInstanceState){
/**
* Check for updated xml file
*/
if (srvUpdate.checkForUpdatesOfXmlFile()) {
showDialog(DIALOG_DOWNLOAD_XML_FILE);
}
/**
* create the list
*/
createXmlListView();
/**
* check for missing files
*/
Integer _iNumberOfUpdates = srvUpdate.checkForUpdatesOfDocumentFiles();
if (_iNumberOfUpdates > 0) {
showDialog(DIALOG_DOWNLOAD_DOCUMENTS);
}
}
Because what happens is the following:
- the program starts
- dialog_download_documents is shown
- the list is shown
- dialog_download_xml_file is shown
All at the same time, goign by the way "I THINK" this is not wanted though.
So far i understand that there is no "wait for user input" in android. What i don't understand however is: "How do other Programs handle such a task when starting the app"?
Any links with the information i need - or even the topics i should look myself into - are greatly appreciated!
thanks in advance
/sam
