Skip to main content

Home/ Android Dev/ Group items tagged position

Rss Feed Group items tagged

Kiran Kuppa

How to Position Views Properly in Layouts | Think Android - 0 views

  •  
    "First off, the difference between android:gravity and android:layout_gravity is that android:gravity positions the contents of that view (i.e. what's inside the view), whereas android:layout_gravity positions the view with respect to its parent (i.e. what the view is contained in). "
Kiran Kuppa

A Visual Guide to Relative Layouts In Android » Mark Lapasa - 0 views

  •  
    " I will walk through the 4 kinds of Relative Layout use cases. 1.Target view position in relation to parenting View Group (i.e. a layout container) 2.Target view alignment in relation to parenting View Group 3.Target view position in relation to another View 4.Target view alignment in relation to another View We'll use Jack and Jill buttons to demonstrate this. The first two categories are in relation to a parent layout (Jack and the parent view group). The last two categories show laying out in relation to another View (i.e. Jack + Jill)"
Vincent Tsao

Mark Murphy | AndroidGuys - 0 views

  • Mark Murphy is the founder of CommonsWare and is the author of _The Busy Coder's Guide to Android Development_, _The Busy Coder's Guide to *Advanced* Android Development_, and _Android Programming Tutorials_.
  •  
    Articles from Mark Murphy
Vincent Tsao

The CommonsBlog - Activity or Notification via Ordered Broadcast - 0 views

  • I’ve run into the following generalized question a lot recently: I have an event that occurs in the background. I want to update my activity, if the activity is on the screen. Otherwise, I want to raise a Notification.
  • Hence, the recipe for the activity-or-Notification pattern is: Define an action string you will use when the event occurs that you want to go to the activity or notification (e.g., com.commonsware.java.packages.are.fun.EVENT). Dynamically register a BroadcastReceiever in your activity, with an IntentFilter set up for the aforementioned action string and with a positive priority (the default priority for a filter is 0). This receiver should then have the activity do whatever it needs to do to update the UI based on this event. The receiver should also call abortBroadcast() to prevent others from getting it. Be sure to register the receiver in onStart() or onResume() and unregister the receiver in the corresponding onStop or onPause() method. Register in your manifest a BroadcastReceiver, with an <intent-filter> set up for the aforementioned action string. This receiver should raise the Notification. In your service (e.g., an IntentService), when the event occurs, call sendOrderedBroadcast(). And that’s it. If the activity is on-screen, its receiver will be registered, so it will get the event, process it, and cancel the broadcast. If the activity is not on-screen, its receiver will not be registered, so the event will go to the default handler, in the form of your manifest-registered BroadcastReceiver, which will raise the Notification.
Vincent Tsao

spinner :: anddev.org - Android Development Community | Android Tutorials - 0 views

  • spnCountries.setAdapter(aspnCountries); spnCountries.setOnItemSelectedListener(spnCountriesListener); private Spinner.OnItemSelectedListener spnCountriesListener =   new Spinner.OnItemSelectedListener() {     public void onItemSelected(AdapterView parent, View v, int position, long id) {       Log.i("print", parent.getSelectedItem().toString());     }     public void onNothingSelected(AdapterView parent) { }              };
1 - 6 of 6
Showing 20 items per page