Click here to Skip to main content
11,924,487 members (54,854 online)
Rate this:
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 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151125.3 | 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