[android-beginners] Re: listview fill parent
Well first of all there are 2 possible ways by which u might be getting each row item... 1 is by defining them in an xml and inflating them at runtime and the other is by directly initiating it through code... supposing that u have used the xml inflation method all u have to do is define the list's width = fill_parent... and similarly in the properties of the xml u have created for items u must have used Linear/ Relative layout in which all items reside... just change its width parameter from wrap_content to fill_parent... this will do the trick... if it doesnt then we'll have to look at the xml of your row which u inflate or incase of making it dynamically through code, we'll have to have a look at the code... On Mar 5, 3:08 pm, Martin Obreshkov manig...@gmail.com wrote: I am sorry for the misleading question - i want the listview items to be stretched to the whole listview On Fri, Mar 5, 2010 at 12:00 PM, manigault manig...@gmail.com wrote: Hi all i have a listview with small number of items but they are still fetched dynamically. How can i make my list view to fill to whole screen no not depending on number of items -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: HelloGoogleMaps : getting error instead of AlertDialog display
Your coding is fine AFAIK... but can u be more specific... i mean wat is the logged error u r getting... sometimes i have seen that just clicking on the map or invalidating the map results in the display of the pin... try shifting the map a little... if it doesnt work, pass me the error generated in the logs... regards, P.S. - My names Vadid dude... On Mar 5, 12:44 am, yodaa yodaa...@gmail.com wrote: @Vavid Yep, you're absolutely right about the constructor. The relevent Context wasn't passed as a parameter to new HelloItemized objet. Something is not clear to me in this tutorial: what is the Context I should pass to the HelloItemized objet? Tutorial URL:http://developer.android.com/resources/tutorials/views/hello-mapview I tried the following (but this did nothing and my android marker has disappeared...): 1 ) File HelloGoogleMaps.java: - package com.tests; import java.util.List; import android.graphics.drawable.Drawable; import android.os.Bundle; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.OverlayItem; public class HelloGoogleMaps extends MapActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MapView mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); ListOverlay mapOverlays = mapView.getOverlays(); Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker); HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this); GeoPoint point = new GeoPoint(1924,-9912); OverlayItem overlayitem = new OverlayItem(point, Hola, Mundo!, I'm in Mexico City!); itemizedoverlay.addOverlay(overlayitem); mapOverlays.add(itemizedoverlay); } @Override protected boolean isRouteDisplayed() { return false; } } 2 ) File : HelloItemizedOverlay.java : package com.tests; import java.util.ArrayList; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.Context; import android.graphics.drawable.Drawable; import com.google.android.maps.ItemizedOverlay; import com.google.android.maps.OverlayItem; public class HelloItemizedOverlay extends ItemizedOverlay { private ArrayListOverlayItem mOverlays = new ArrayListOverlayItem(); private Context mContext; public HelloItemizedOverlay(Drawable defaultMarker, Context context) { super(defaultMarker); mContext = context; } public void addOverlay(OverlayItem overlay) { mOverlays.add(overlay); populate(); } @Override protected OverlayItem createItem(int i) { return mOverlays.get(i); } @Override public int size() { return mOverlays.size(); } @Override protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index); AlertDialog.Builder dialog = new AlertDialog.Builder(mContext); dialog.setTitle(item.getTitle()); dialog.setMessage(item.getSnippet()); dialog.show(); return true; } } Help would be appreciated... On 26 fév, 05:52, Vadid Valiulla its.va...@gmail.com wrote: Actually your problem is that the Dialog is not getting the correct context... Coz the constructor u initialized doesnt have the context passed to it... Check that and i suppose your problem should get solved... sorry 4 sending another message i forgot to mention the reason i gave the re-defined constructor... Take care... -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: IllegalArgumentException occurs when passing url to post data ... plz help
hi Wahib, What you can do is replace the space character with some valid character like %20 or _... I also faced the same problem... Wat i did was use urString.replace(' ', '_') this kindof did my job... But your case mayb different.. you can try replacing the character with %20 coz spaces aren't valid url parameters... Hope this solves ur problem... On Mar 3, 9:46 am, wahib wahib.t...@gmail.com wrote: hi experts !! I am stuck with this issue. I am trying to send a string to a url which is like http://10.3.12.165/android/geteventlist.php?event_search_string=entered by user in a edittext it works fine if user enters a string without spaces. But as user enters a string with spaces this error is posted in the logcat. java.lang.IllegalArgumentException: Illegal character in query at index 71:http://10.3.12.165/android/geteventlist.php?event_search_string=Concert at LUMS E/AndroidRuntime( 271): at org.apache.http.client.methods.HttpGet.init(HttpGet.java:75) E/AndroidRuntime( 271): at com.eventify.app1.listevents.geteventlist_fromDB(listevents.java:121) E/AndroidRuntime( 271): at com.eventify.app1.listevents $1.onClick(listevents.java:55) E/AndroidRuntime( 271): at android.view.View.performClick(View.java: 2344) E/AndroidRuntime( 271): at android.view.View.onTouchEvent(View.java: 4133) E/AndroidRuntime( 271): at android.view.View.dispatchTouchEvent(View.java:3672) E/AndroidRuntime( 271): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 271): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 271): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 271): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) E/AndroidRuntime( 271): at com.android.internal.policy.impl.PhoneWindow $DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) E/AndroidRuntime( 271): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java: 1202) E/AndroidRuntime( 271): at android.app.Activity.dispatchTouchEvent(Activity.java:1987) E/AndroidRuntime( 271): at com.android.internal.policy.impl.PhoneWindow $DecorView.dispatchTouchEvent(PhoneWindow.java:1696) E/AndroidRuntime( 271): at android.view.ViewRoot.handleMessage(ViewRoot.java:1658) E/AndroidRuntime( 271): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 271): at android.os.Looper.loop(Looper.java: 123) E/AndroidRuntime( 271): at android.app.ActivityThread.main(ActivityThread.java:4203) E/AndroidRuntime( 271): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 271): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 271): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791) E/AndroidRuntime( 271): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) E/AndroidRuntime( 271): at dalvik.system.NativeStart.main(Native Method) how would i convert the string to a format when it gives no exception. The problem is that i have to pass this complete url string with variable to HttpGet object like... HttpGet request = new HttpGet(url); ///url is of type String so i have to pass it as a string type only. kindly help me out. Regards, wahib -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en