Showing posts with label Activity. Show all posts
Showing posts with label Activity. Show all posts

6/1/12

How to make activity to appear in Dialog style

If you want activity to upear like picture below
 
You need to modifiy  activity definition inside  AndroidManifest as  following  :


<activity android:name=".ItemEdit" android:theme="@android:style/Theme.Dialog"></activity>



As you can see - the 'Edit Item' screen is ready now. you can modify here the name of item and quantity.

5/20/12

How to make screen (or window) in Adndroid

In android programming, screen or window object named Activity.
Here is example code that display list of items from simple strings array :
public class NisuiActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        ListView lv= (ListView)findViewById(R.id.listview);

        

        // create the grid item mapping

        String[] from = new String[] {"rowid"};
        int[] to = new int[] { R.id.item1 };

 

        // prepare the list of all records

        List<hashmap<string, string>> fillMaps = new ArrayList<hashmap<string, string>>();

        for(int i = 0; i < 10; i++){

            HashMap<string, string> map = new HashMap<string, string>();
            map.put("rowid", "" + i);

            fillMaps.add(map);

        }

 

        // fill in the grid_item layout
        SimpleAdapter adapter = new SimpleAdapter(this, fillMaps, R.layout.grid_item, from, to);
        lv.setAdapter(adapter);        
        
        
    }

}

When you run the code you got something like this:

Getting started with docker

It is very simple to get started usig docker. All you need to do-is download the docker desktop for your system Once you get docker syste...