Hello, I am trying to retrieve the value from a Arraylist/ArrayAdapter that I have populated. I believe my issue is at the Onitemclick event. What I would like to accomplished is that when I click on Yasmin, I can return the value of 8. Please let me know if I am on the right track
import java.util.ArrayList;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
public class lister extends Activity {
/** Called when the activity is first created. */
TextView txHomeTeam;
protected ListView mFavlist;
protected ArrayList fakeFavs = new ArrayList();
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
this.setContentView(R.layout.main);
this.txHomeTeam = (TextView)this.findViewById(R.id.title);
fakeFavs.add(new Favorite("John", "1"));
fakeFavs.add(new Favorite("Yasmin", "8"));
fakeFavs.add(new Favorite("Jack", "10"));
//this.mFavlist = (ListView) this.findViewById(R.id.list_favorites);
this.mFavlist = (ListView) this.findViewById(R.id.list_favorites);
initListView();
mFavlist.setTextFilterEnabled(true);
mFavlist.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView arg0, View view,
int position, long id) {
// user clicked a list item,
//and read the value from <Favorite>.value
//txHomeTeam.setText=????
}
});
}
public void refreshFavListItems() {
mFavlist.setAdapter(new ArrayAdapter(this,
android.R.layout.simple_list_item_1, fakeFavs));
}
public void initListView() {
/* Loads the items to the ListView. */
refreshFavListItems();
}
protected class Favorite {
protected String Detail;
protected String value;
protected Favorite(String Detail, String value) {
this.Detail = Detail;
this.value = value;
}
public String toString() {
return Detail;
}
}
}
Is it possible to add a button to the right corner of the app title?
e.g., adding a "refresh" button to the title of "Feed: my feeds"?
http://www.android.com/market/apps/feedr-lg-01.jpg
Here is how I setup my checked text view. How come no check box appeared?
I also added this but it had not effect:
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
> <CheckedTextView
> android:id="@+id/ctv_checktext"
> android:layout_width="fill_parent"
> android:paddingLeft="2px"
> android:paddingRight="2px"
> android:paddingTop="2px"
> android:layout_height="wrap_content"
> />
I am confused as to the difference between the two. In my application I have just used Extends Activity and the application is working perfectly, so what is the purpose of Extends Application?.
Would you use it on the first class you create in the Android application?
Thanks.
Ok so I have two BroadcastReceiver registered. When the app is closed they both fire at the appropriate times and do the appropriate things.
If the app is closed then killed (say with an AppKiller), the receivers never receive their broadcasts, and nothing happens.
Presumably the same thing happens if the parent app is killed due to low memory, so how do I ensure those broadcasts are fired/received. The API states that even if the app is killed it should fire, does anyone else have experience with this situation?
If it helps my manifest is:
<!-- receivers for AlarmManager -->
<receiver
android:exported="true"
android:label="Shift roster updating calendar."
android:name="com.skooter.shiftroster.backend.service.UpdateCalendar"
>
</receiver>
<receiver
android:exported="true"
android:label="Shift roster checking alarm."
android:name="com.skooter.shiftroster.backend.service.SetWakeup"
>
</receiver>
and nothing esoteric is going on in the AlarmManager/BroadcastReceivers
I'm up and running in Eclipse, have worked through several tutorials and would like to start developing my first marketable app. Is there anyplace I can find a comprehensive list or catalog of what's available on the Android marketplace? I'd hate to waste a lot of development time building an app that has twelve free versions already available.
Hey there,
I've heard about web scraping software that can take data from a webpage. i'm building an android app and I want to take information from this site www.menupages.ie
All I need is the names of the restaurants, and typing them in myself would be very tedious.
Can someone tell me how i'd go about doing this in eclipse, what methods i need etc.
I dont know anything about it.
Thanks alot.
I have integrated the Pushwoosh SDK in my Android Application and it is working fine.
I have done the Cross Platform Setting to run the Android Application on my Blackberry Z10 device, the application is running finely but I am not able to receive the Notification on my Blackberry Z10 device as Android.
I am getting this error:
06-06 14:34:21.314: I/QNXNavigatorClient(8708260): Already active: com.packagename.pushdemo
06-06 14:34:21.662: I/QNXNavigatorClient(8708260): PackagesOpenedRunnable: [com.packagename.pushdemo]
06-06 14:34:21.662: I/QNXNavigatorClient(8708260): Shell com.packagename.pushdemo cannot join group, group was already joined
06-06 14:34:21.668: I/ActivityManager(8708260): Displayed com.packagename.pushdemo/.MainActivity: +347ms
06-06 14:34:24.118: E/QNXShrimpClient(8708260): com.google.android.c2dm.intent.REGISTER error(10108) = ""
06-06 14:34:24.124: W/ContextImpl(8708260): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendOrderedBroadcast:1061 com.android.server.QNXShrimpClient.onRegisterComplete:162 com.qnx.service.pps.shrimp.ShrimpController.onMessageReceived:128 com.qnx.service.pps.PPSObject.processMessage:292
com.qnx.service.pps.PPSObject.access$500:11
I am not able to get the Push Notification on my Blackberry Z10 device.
As per my question here...
http://www.jetbrains.net/devnet/message/5261667#5261667
Is it possible to use TeamCity with an Idea 9 project project that has 3 .iml modules where 2 are Java based and 1 in an Android module?
Hi,
I want to send the following JSON text {"Email":"[email protected]","Password":"123456"} to a web service and read the response. I know to how to read JSON. The problem is that the above jason object must be sent in a variable name jason. How can i do this from android? Like creating a request object setting content headers etc.
Title says it all. My app code is starting to get unmanageable and I want to start source control, primarily because I need to branch my code.
What are some good systems that you have used in the past and what would you recommend to me.
Requirements:
Must be free
Must integrate with eclipse
Must work well with android development plugin
I want to store locations in my Android phone and be able for the application to tell me if I am inside these points&radius.
What is the best way to store many point&radius locations and efficiently query for them?
How do I add a View dynamically in an android widget?
I realize that the RemoteViews works as a container of updates, but the RemoteViews.addView is only available on API level 7 (and I want my widget to work on HTC Hero phones, which has API level 3).
Hey Everyone,
I was checking out the Google Maps Data API and I was wondering if I can follow their Java Development guide to use it on the Android platform? I want to display routes that I have created on Google Maps on the phone.
Thanks,
Rob
In my android app I have a Tabhost with a ListView as one of the tabs. By clicking on an item in the ListView (an address) I start an Intent to Google Maps for directions and the choice dialog pops up for google maps, web browser etc. Problem is if I press the hard back button then the launch dialog goes away but also the ListView is cleared. Any idea why?
Does anyone know, if vendors provide or if there is a site where one could download AVD profiles for existing android devices on the market so you can run your apps in the emulator and basically see how they will run on said devices?
I know it's pretty easy to create a new device but it'd be great if one could just download the config file for each device and run it.
It is a common thing to add a color name and a color RGB value in a config xml file for developing an Android application. It is boring sometimes for example, when I want to add color pink, I had to find some tool to show me what the exact RGB value for it and then fill it in that xml file.
I am wondering is there any predefined color file?
Are there known issues with navigator.onLine on Android 2.1? I have a Droid on airplane mode, but navigator.onLine appears to be returning true anyway. (I'm using an HTML manifest to cache the page, and its behavior works fine in Mobile Safari and Firefox in offline mode.)
I know you can change buttons background by creating a simple XML file, like this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_window_focused="false"
android:state_enabled="true"
android:drawable="@drawable/button_normal"
/>
<!-- ... -->
</selection>
I was wondering if it is possible to use a similar approach to change the style attribute of an element using the same (or similar) technique.
Or, if that is not possible, how can the style attribute be changed during runtime (there is no such thing as button.setStyle(R.style.button)).
I have an android phone and am thinking of a project in which I will need to modify the operating system and reinstall it to the phone. Is this possible to do so? Can i be sure my phone is not gonna give up on me?
Thanks.
How can I integrate services like Google or Microsoft and use information from the user like Google Calendar information. For example, how would I sync the Microsoft Outlook notes with an app on Android?
Is there a simple way to tell the default media player to change track back or forward?
I want the ability to send commands to the system media player (Music) to change track back and forward from within my app.
Is there a simple way? Code examples or descriptive explanation please, I have not developed for Android before.
Hi,
I would like to know how to start and code a thread manager for my Android App.
My app is going to fill a list with a network I/O and I have to manage threads for that.
I never done this before and I don't know where to start. I heard about Thread Pool and other stuff, but I'm quite confused. Could someone please help me make my way through ?
Thanks
Hello,
I am currently developing an free application (TaskOS ) that allow users to have multitasking and switch easily between applications on their mobile ( like alt+tab in Windows )
That work pretty well and user can launch my application by a long press on the "search" button" by adding this line in the manifest:
<action android:name="android.intent.action.SEARCH_LONG_PRESS" />
I also succeed to allow to the users to Use the camera button ( they can of course disable that in application settings) and the way to do that is slighlty different:
<receiver android:name=".CameraPressed">
<intent-filter android:priority="10000">
<action android:name="android.intent.action.CAMERA_BUTTON"/>
</intent-filter>
I am now wondering if there are other ways to launch easily my task switcher?
( long press on Home key, long press on trackball, or any other idea.)
Reading the Google documentation does not help me a lot.
Any other idea/suggestion would be warmly welcome.
Christophe