Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7860983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:30:52+00:00 2026-06-02T22:30:52+00:00

I am writing an app that is essentially a card that can be flipped.Both

  • 0

I am writing an app that is essentially a card that can be flipped.Both side have certain relevant data say hint on one side and picture on another.Both sides of data are related.My problem is i can navigate through the cards by clicking next but when i flip the card for picture, i get back to the beginning since the first activity is reloaded.How can i solve the issue? My code is:
package org.v2.greTouch;

import java.io.IOException;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

public class FlipCard extends Activity  implements View.OnClickListener {
/** Called when the activity is first created. */
 Cursor cur;
TextView tv;
DbH db;
ImageButton next,back;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    tv=(TextView)findViewById(R.id.TV_Word);
    next=(ImageButton)findViewById(R.id.next);
    back=(ImageButton)findViewById(R.id.back);
    next.setOnClickListener(this);
    back.setOnClickListener(this);
    LinearLayout turn;
    turn=(LinearLayout)findViewById(R.id.LL_Card);
    turn.setOnClickListener(this);
    try {
        db=new DbH(this);
    } catch (IOException e2) {

        e2.printStackTrace();
    }


        try {
            db.createdatabase();
        } catch (IOException e) {

            e.printStackTrace();
        }

     db.opendatabase();
     cur=db.data();
     cur.moveToFirst();
     tv.setText(cur.getString(0));

 }
  @Override
  public void onClick(View v) {

switch(v.getId())
{
case R.id.next :
    if(cur.isLast())
    {
        cur.moveToFirst();
        tv.setText(""+cur.getString(0));
    }
    else
    {
        cur.moveToNext();
    tv.setText(""+cur.getString(0));

    }
break;
case R.id.back:
{
    if(cur.isFirst())
    {
        cur.moveToLast();
        tv.setText(""+cur.getString(0));
    }
    else {cur.moveToPrevious();
    tv.setText(""+cur.getString(0));
    }
    break;
}
case R.id.LL_Card:
{
    Intent i=new Intent(this,FlashCard_back.class);
    startActivity(i);
}
}
}
}

The other side that is loaded is :

   import android.app.Activity;
   import android.content.Intent;
   import android.os.Bundle;
   import android.view.View;
   import android.view.View.OnClickListener;
   import android.widget.LinearLayout;
   import android.widget.TextView;
    public class FlashCard_back extends Activity implements OnClickListener{
   /** Called when the activity is first created. */
   @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_back);
    LinearLayout layMain = (LinearLayout) findViewById(R.id.FlashCardRear);
    layMain.setOnClickListener(this);
     }
     public void onClick(View v) {
    Intent i=new Intent(this,FlipCard.class);
    startActivity(i);
     }
     }

I want that when i filp back i should get the same card awith values extracted from database.
Pls help out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:30:53+00:00Added an answer on June 2, 2026 at 10:30 pm

    u can use ViewFlipper to flip the screen display.for that do as following in a single xml file,

    <ViewFlipper>
        <LinearLayout>
              //front page's elements
        </LinearLayout>
    
        <LinearLayout>
             //back page's elements
        </LinearLayout>
    </ViewFlipper>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an app that is essentially a flipcard that shows word/hint on
Currently writing an app that should be able to quicklook webarchive. Copied data from
I'm re-writing an app that is a data-entry tool. The existing app is in
I am writing an app that I can feed tasks with multiple steps. I
This post is similar to: this I have a console app that expects both
I am writing an app that uses Highcharts, and in one instance I want
i'm writing an app that needs a calculation support (Fun project). However, is there
I am writing an app that plays a url using MPMoviePlayerController. The app works
I'm writing an app that has a view with nested UITableViews. The UITableViews in
I am writing an app that interfaces with the iPhone address book. Here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.