Click here to Skip to main content
11,803,861 members (76,990 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Mobile 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 0:41am
Edited 13-Jun-13 0: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 450
1 CPallini 320
2 F-ES Sitecore 240
3 Sergey Alexandrovich Kryukov 234
4 CHill60 220
0 OriginalGriff 3,000
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,755
4 Richard MacCutchan 1,187

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 13 Jun 2013
Copyright © CodeProject, 1999-2015
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