Skip to main content

Custome Listview with Hashmap in ANDROID





1) Go to res/Lauout/main.xml :-

2) Now Nextgot o res/Layout/row.xml :-


3) Now go to main Activity:- 





Comments

  1. how can i onclick on list item?????

    ReplyDelete
  2. onListItemClick(ListView l, View v, int position, long id)

    This method will be called when an item in the list is selected.

    you have to create this method like:

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
    // TODO Auto-generated method stub
    super.onListItemClick(l, v, position, id);
    }

    where,

    ListView l : is your listview
    int position: position of listview item(which item is selected)

    ReplyDelete

Post a Comment

Popular posts from this blog

Why Domain-Specific AI Agents Beat One Big Agent

Everyone is building agents right now. Real estate firms. Independent insurance brokers. Fortune 500 companies with budgets big enough to hire an army of consultants. Ask around and you'll hear the same story everywhere: "we're building our own agent." And yet almost nobody is asking the obvious question: why does the default approach keep failing? One large, general-purpose agent gets wired up to every tool the business owns. It impresses in the demo. Then it quietly stalls before production. There's a gap between what businesses want and what they're actually getting. They want AI woven into their data, their workflows, their day-to-day operations. What they get instead is one oversized agent trying to be a sales rep, a compliance officer, and a customer support line, all at once. That gap is an architecture problem, not a model problem. Key Takeaways The default "one big agent" pattern breaks down on context bloat, cost, fragility, and portability...

How Create AVD for Samsung Galaxy Tab

1. Open the Android AVD and SDK Manager  2.  Select Available Packages in the left panel of AVD Manager. 3.  Click “Add ADD-on Site” and enter the URL below. http://innovator.samsungmobile.com/android/repository/srepository.xml   4. Check Samsung GALAXY Tab Add-on packages and click install button. 5. Check Samsung GALAXY Tab Add-on license & Click install button. 6) After downloading and installation of GALAXY Tab Add-on, you should restart ADB (Android Debug Bridge) or Eclipse. The important specs of this device, from an Emulator perspective, are: Target platform: Android 2.2, Galaxy Tab Screen Info: High Density, despite the fact that it’s not, this is what it reports, WSVGA (1024×600) No keyboard Has dual cameras Let’s create an AVD configuration called GalaxyTab: Within Eclipse, launch the Android SDK and AVD Manager Select “Virtual Devices” from the left-hand options Click the “New” button to create a new AVD configura...

Android show Data from Sqlite DB into Grid View

Shaadi.com Matrimonials Shaadi.com Indian Matrimonials Your Main Activity class package com . Sqlite_grid_view ; import java . util . ArrayList ; import java . util . List ; import android . app . Activity ; import android . os . Bundle ; import android . util . Log ; import android . view . View ; import android . widget . AdapterView ; import android . widget . AdapterView . OnItemClickListener ; import android . widget . ArrayAdapter ; import android . widget . GridView ; import android . widget . TextView ; import android . widget . Toast ; public class AndroidSQLiteTutorialActivity extends Activity { private GridView gridView ; public static ArrayList < String > ArrayofName = new ArrayList < String >(); /** Called when the activity is first created. */ @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . l...