I have a button in the inflated xml and I wanted to take it's xml id .Please help me with some stuff........ I have inflated something like this.\[code\]RelativeLayout mainLayout = (RelativeLayout)findViewById(R.id.relative);\[/code\]//create a view to inflate the layout_item (the xml with the textView created before)\[code\]view = getLayoutInflater().inflate(R.layout.inflate, mainLayout,false);\[/code\]//add the view to the main layout\[code\]mainLayout.addView(view);\[/code\]