android-intent

Alert Box in Android doesn't let me to click, just directly performs the action

蓝咒 提交于 2019-12-31 06:23:10
问题 I've a button upon clicking should display an alertdialog box containing just "OK" button and upon clicking should go to another activity. But this dialog box appears for a few seconds and goes to the activity without letting me click or confirm it. This is the code i've used public void onClick(View v) { AlertDialog.Builder alertbox = new AlertDialog.Builder(InsertData.this); alertbox.setMessage("Object Location Stored!"); alertbox.setPositiveButton("Ok", new DialogInterface.OnClickListener(

creating parcelable in android from some of the fields of a class

我们两清 提交于 2019-12-31 05:44:13
问题 i have the following class which i intent to pass from one activity to another: public class Ad extends ListItem implements parcelable{ private String _type; private String _recordID; private String _line1; private String _line2; private String _line3; private String _line4; private String _url; private IOnUiNeedToUpdateListener _listener; private boolean _notActive = false; private String _alertText; private Double _longitude; private Double _latitude; } i want to pass an array of such

How to start new intent after search-filtering listview?

こ雲淡風輕ζ 提交于 2019-12-31 05:20:31
问题 Hi guys I have a question: I created a listview, with search-bar etc . So when I click on an item (through switch-case) the selected new activity opens and there are no problems. you can see the code here: Filtered list item opens the original list items' activity The problems start when I filter the listview, with the search-bar, and instead of opening the selected activity (let us say activity 10), it throws me back to activity 1 and so forth. What I have figured out so far is that most

Android XML Parsing with RSS

拜拜、爱过 提交于 2019-12-31 05:20:06
问题 I have My Rss File Items : <item > <title>Prasad</title> <link>http://www.tele.com/rssHostDescr.php?hostId=15</link> <guid isPermaLink="false">http://www.tele.com/rssHostDescr.php?hostId=14</guid> <pubDate>2013-04-10</pubDate> <description>Prasad</description> <media:thumbnail width='66' height='49' url='http://www.tele.com/hos/Panthi-image.jpg'></media:thumbnail> </item> <item> ........................ </item> etc..................... I'm trying to parse the above file,I'm able to get all

How to parse xml using different parent nodes in android

一世执手 提交于 2019-12-31 05:15:32
问题 In my xml file I have two or more parent nodes like:- //parent node pizza //attributes are 1 Veg Pizza //parent node burger //attributes are 1 Veg Burger, Whenever the user clicks on pizza listview item then the user should be able to view only list of pizza items in another activity's listview . I know how to call next activity and so on, but I want to know how I can use different parent nodes in my java class, exactly what are the changes I need to do in my java class, please see this link,

capture photo from both front and back camera simultaneously

巧了我就是萌 提交于 2019-12-31 04:50:07
问题 I would like to develop an Android application which has the technique of capturing a photo from camera(both front and back) at simultaneously.I searched over internet but unfortunately I couldn't find any better solution. note for example if I capture the photo from back camera,once it captured from back means then it has to start front camera automatically for capture a photo. 回答1: You need to approach this problem step by step. First build functionality to take picture by back camera. Once

how to directly pass value of a variable from 1st activty to 3rd activity using putextra?

醉酒当歌 提交于 2019-12-31 04:36:12
问题 how to directly pass value of a variable from 1st activity to 3rd activity using putextra? For example: I have a variable A in the first screen (first activity) if I hit the button it will show the 2nd screen. The 2nd screen(2nd activity) has a button. If I click the button it will open the 3rd screen(3rd activity) and it will show the variable A in the textview of 3rd screen (3rd activity). how can I pass the value of variable A from the first screen DIRECTLY to the third screen(third

How do I display no internet connection popup and an html page when internet is not available for webview?

二次信任 提交于 2019-12-31 03:50:30
问题 I am using webviews in my app and want to make sure when internet is not available the pop up message displays for no internet connection and also displays an html page in the background saying internet connection required. I have added some code for checking internet connection, but its not working/ showing errors for checkmark(code added based on online research). Any clue how to fix the same? Here's the code below: public void onCreate(Bundle savedInstanceState){ super.onCreate

Using startActivityForResult across Android applications

时光怂恿深爱的人放手 提交于 2019-12-31 03:27:06
问题 I have written an application that has an <intent-filter/> so that other applications can start it using startActivityForResult() . When this activity is finished it has created an object that is like: (Application A) public class MyObject implements Serializable { private String name; private String[] items } And set's it on the result: (Application A) getIntent().putExtra("Extra_MyObject", myObject); setResult(RESULT_OK, getIntent()); So the second activity that is recieving this intent has

How to specify filename for ACTION_SEND?

狂风中的少年 提交于 2019-12-31 03:12:09
问题 I'm using ACTION_SEND to send a file from the content provider in my app as an email attachment in GMail. This works great, except that I can't programmatically specify the filename of the attachment. When my URI is content://my.documentcontentprovider/321 The filename of the attachment is 321. 321 is the document id. I looked at the spec for Intent, and don't see an EXTRA_ key for specifying the filename. The only workaround I could come up with is to append the filename to my URI: content:/