Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Android
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 to the edit text value to be added in the View Pager.It is returning null value
Posted 13-Jun-13 1:41am
Edited 13-Jun-13 1:42am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I hope this link can help you visit here:[^]
If do you want to know more question you can ask with our development team of androids.
Android Application Developers
shanmuga1509 at 13-Jun-13 6:53am
Actual requirement is i want to pass the edit text value to a class which extends PagerAdapter. Your solution helps me for passing the value from one activity to another activity.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 410
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 105
4 PIEBALDconsult 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220

Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 13 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100