How to click one button then popup one full-window?

Put your problem here if it does not fit any of the other categories.

How to click one button then popup one full-window?

Postby massmoss » Tue Mar 18, 2008 2:04 pm

Hello,

I try to implement one simple program: When I click the button, it will popup full size window rather than showalert(…). Referred the tutorial of “Generalized File Manager”, I have written following code. But there is no response when I click the button. Please help to check and your suggestion are highly appreciated.

massmoss


1.
package com.wirelessculture.MainActivity;

import android.app.Activity;
import android.os.Bundle;

import java.text.NumberFormat;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity {
/** Called when the activity is first created. */

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);

Button calc1 = (Button)this.findViewById(R.id.calc1);

calc1.setOnClickListener(calc1OnClick); //Popup new Window by click
}

OnClickListener calc1OnClick = new OnClickListener()
{
public void onClick(View v) {
//Popup one full size window
PopWindow myPop=new PopWindow();
}

};

}

2.
package com.wirelessculture.MainActivity;

import android.app.Activity;
import android.os.Bundle;

import java.text.NumberFormat;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class PopWindow extends Activity{

@Override
protected void onCreate(Bundle icicle) {
// TODO Auto-generated method stub
super.onCreate(icicle);

setContentView(R.layout.main);

this.setTheme(1);

}

}
massmoss
Junior Developer
Junior Developer
 
Posts: 16
Joined: Sat Jan 19, 2008 4:34 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 19 guests