Hi,
You can you LayoutInflater to for setting layout dialog.
Here is example code:
LayoutInflater factory = LayoutInflater.from(this);
final View testview = factory.inflate(R.layou.new_layout, null);
// process get all view your new layout
your_dialog.setTitle("'');
your_dialog.setView(testView);
...
On Thu, Apr 29, 2010 at 2:26 PM, karteek22 <[email protected]> wrote:
> Hi,
> How can we use more than one layout file.
> I have implemented a cutom dialog.That means i have created an layout file
> for dialog.
> And one layout file for my activity.
> But whatever the UI items in dialog layout ile if iam using them by
> findViewById it is giving me null
>
> I will explain indetails here
> @Override
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.main);
> applicationContext=getApplicationContext();
>
> Dialog folder=new Dialog(this);
> folder.setTitle("Creating folder");
> folder.setContentView(R.layout.create_folder);
> TextView tv=findViewById(R.id.folder_text); //Here folder_text is
> in my second layoutfile ie in create_folder.xml
> //In the above statemet i got the null to tv variable.
> folder.show();
>
> }
>
> Any suggestions please
>
> Regards,
> Karteek
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en