Two Laptop Bag
The moose likes Android and the fly likes Android Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Android" Watch "Android" New topic


shanmugi try

Joined: Jun 04, 2013
Posts: 3
String result;
protected void onCreate(Bundle savedInstanceState) {
et1 = (EditText) this.findViewById(;
t1 = (TextView) this.findViewById(;
t2 = (TextView) this.findViewById(;
b1 = (Button) this.findViewById(;
b2 = (Button) this.findViewById(;
b1.setOnClickListener(new View.OnClickListener() {

public void onClick(View v) {
result = et1.getText().toString();

b2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(v.getContext(),ThirdActivity.class);
public String value(){
return result;
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(, menu);
return true;

public class Text extends PagerAdapter{

Context context;
SecondActivity s = new SecondActivity();
private String[] textViewer = new String[]{

public ImageAdapter(Context context){
this.context= context;

public int getCount() {
return textViewer.length;

public boolean isViewFromObject(View view, Object object) {
return view==((TextView)object);
public Object instantiateItem(ViewGroup container, int position) {
TextView textView = new TextView(context);
((ViewPager) container).addView(textView, 0);
return textView;

public void destroyItem(ViewGroup container, int position, Object object) {
((ViewPager) container).removeView((TextView) object);


I want the edit text value to be added in the View Pager.It is returning null value.Actual requirement is i want to pass the edit text value to a class which extends PagerAdapter
Steve Luke

Joined: Jan 28, 2003
Posts: 4181

Hi Shanmugi,

Welcome to the Ranch! When posting code, please UseCodeTags (<- click that link). It will make it a lot easier to read. I also removed the duplicate post.

I tried looking at your code and it is just not readable in the state it is in now, and the question isn't very clear either. Could you re-post the code you are having trouble with (just the parts with the issue - and don't forget to UseCodeTags ;) )? Then restate the problem a different way?

I agree. Here's the link:
subject: Android
It's not a secret anymore!