Displaying different layout in eclipse when using ViewFlipper

by Stephen Lebed » Tue, 20 Apr 2010 22:51:55 GMT

Sponsored Links
 Hi all,

I have a layout I'm creating that uses ViewFlipper for different
screens.  In eclipse's layout editor it only displays the first page
in the View.  Is there a keyboard shortcut, or function to flip to the
next screen?  Currently I'm building each screen in a seperate XML
file and then copying and pasting it into the main XML file.

Is there a better way to work here?

Stephen Lebed


Displaying different layout in eclipse when using ViewFlipper

by Kumar Bibek » Thu, 22 Apr 2010 17:54:15 GMT

 No you can't . You will have to run it to see it .

Thanks and Regards,
Kumar Bibek


Sponsored Links

Other Threads

1. Application crashes when I try to retrieve colums from a dbRow

The LaunchFav crashes at the first i.putExtra.  The error is "The
application Track My Drinks (process.parisj13.trackmydrinks) has stopped
unexpectedly.  What am I doing wrong?

        private Intent LaunchFav()
                Cursor c = mFavDrink.fetchAllDrinks();
                Intent i = new Intent(this, FavoriteDrink.class);
                if(c.isBeforeFirst() && c.isAfterLast()){
                        return i;
                i.putExtra(TrackMyDrinksDbAdapter.KEY_DRINK_NAME, c.getString(
                i.putExtra(TrackMyDrinksDbAdapter.KEY_{*filter*}_VOL, c.getDouble(


                i.putExtra(TrackMyDrinksDbAdapter.KEY_DRINK_ID, c.getInt(
                return i;

This code is the code that puts a record or updates a record when

        private void ProcessFavorite(Intent i)
                Bundle extras = i.getExtras();
                TextView tv = (TextView)this.findViewById(R.id.Otheramt);
                String FavName =
                double AlcVol =
extras.getDouble(TrackMyDrinksDbAdapter.KEY_{*filter*}_VOL, 0.00);
                double AlcPerc =
extras.getDouble(TrackMyDrinksDbAdapter.KEY_{*filter*}_PERC, 0.00);
                long RowId = 
                double curAlc = AlcVol * AlcPerc;
                mCurrentTime = new Date();
                if(mBAC == 0){
                        mStartTime = (Date) mCurrentTime.clone();
                if(RowId == -1)
                        mFavDrink.createDrink(FavName, AlcVol, AlcPerc);
                        mFavDrink.updateDrink(RowId, FavName, AlcVol, AlcPerc);
                mTot{*filter*} = mTot{*filter*} + curAlc;

This is my entire DB Helper class.

package com.parisj13.trackmydrinks;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

class TrackMyDrinksDbAdapter {
        public static final String KEY_DRINK_NAME ="drinkname";
        public static final String KEY_{*filter*}_VOL ="volume";
        public static final String KEY_{*filter*}_PERC = "perc";
        public static final String KEY_DRINK_ID = "_id";
        private static final String TAG = "TrackMyDrinksDbAdapter";
        private DatabaseHelper mDbHelper;
    private SQLiteDatabase mDb;
    private static final String DATABASE_CREATE =
        "create table drink (_id integer primary key autoincrement, "
                + "drinkname text not null, volume double not null, perc
double not null);";

    private static final String DATABASE_NAME = "trackmydrinks";
    private static final String DATABASE_TABLE = "drink";
    private static final int DATABASE_VERSION = 2;
    private final Context mCtx;

    private static class DatabaseHelper extends SQLiteOpenHelper {

                public DatabaseHelper(Context context) {
                        super(context, DATABASE_NAME, null, DATABASE_VERSION);

                public void onCreate(SQLiteDatabase db) {

                public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {
            Log.w(TAG, "Upgrading database from version " + oldVersion +
" to "
                    + newVersion + ", which will destroy all old data");
            db.execSQL("DROP TABLE IF EXISTS drink");

     * Constructor - takes the context to allow the database to be
     * opened/created
     * @param ctx the Context within which to work
    public TrackMyDrinksDbAdapter(Context ctx){
        this.mCtx = ctx;
     * Open the notes database. If it cannot be opened, try to create a
     * instance of the database. If it cannot be created, throw an
exception to
     * signal the failure
     * @return this (self reference, allowing this to be chained in an
     *         initialization call)
     * @throws SQLException if the database could be neither opened or
    public TrackMyDrinksDbAdapter open() throws SQLException {
        mDbHelper = new DatabaseHelper(mCtx);
        mDb = mDbHelper.getWritableDatabase();
        return this;            
    public void close() {
     * Create a new drink using the name, {*filter*} volume and {*filter*}
     * provided. If the drink is successfully created return the new
rowId for 
     * that drink, otherwise return a -1 to indicate failure.
    public long createDrink(String drinkName, double alcvol, double
        ContentValues initialValues = new ContentValues();
        initialValues.put(KEY_DRINK_NAME, drinkName);
        initialValues.put(KEY_{*filter*}_VOL, alcvol);
        initialValues.put(KEY_{*filter*}_PERC, alcperc);

        return mDb.insert(DATABASE_TABLE, null, initialValues);
     * Return a Cursor over the list of all drinks in the database
     * @return Cursor over all notes
    public Cursor fetchAllDrinks() {
        return mDb.query(DATABASE_TABLE, new String[] {KEY_DRINK_ID,
                        KEY_{*filter*}_VOL, KEY_{*filter*}_PERC}, null, null, null, 
     * Return a Cursor positioned at the note that matches the given
     * @param rowId id of note to retrieve
     * @return Cursor positioned to matching drink, if found
     * @throws SQLException if note could not be found/retrieved
    public Cursor fetchDrink(long rowId) throws SQLException {
        Cursor mCursor =
                mDb.query(true, DATABASE_TABLE, new String[] {KEY_DRINK_ID,
                    KEY_DRINK_NAME, KEY_{*filter*}_VOL, KEY_{*filter*}_PERC},
KEY_DRINK_ID + "=" + rowId, null,
                    null, null, null, null);
        if (mCursor != null) {
        return mCursor;
     * Update the note using the details provided. The note to be
updated is
     * specified using the rowId, and it is altered to use the title and
     * values passed in
     * @param rowId id of drink to update
     * @param name value to set drink name to
     * @param alcvol value to set {*filter*} volume to
     * @param alcperc value to set {*filter*} percent to
     * @return true if the note was successfully updated, false
    public boolean updateDrink(long rowId, String name, double alcvol,
double alcperc) {
        ContentValues args = new ContentValues();
        args.put(KEY_DRINK_NAME, name);
        args.put(KEY_{*filter*}_VOL, alcvol);
        args.put(KEY_{*filter*}_PERC, alcperc);
        return mDb.update(DATABASE_TABLE, args, KEY_DRINK_ID + "=" +
rowId, null) > 0;


2. Intel announces new Pentium III brand for next generation processors.

M2 PRESSWIRE-12 January 1999-INTEL: Intel announces new Pentium III
brand for next generation processors (C)1994-99 M2 COMMUNICATIONS LTD
RDATE:110199 SANTA CLARA, Calif. -- Intel Corporation today announced
the Intel Pentium III processor brand name for its next generation
microprocessor code-named Katmai.

for more info http://www.intel-intel99.blogspot.com/

3. Popup Blocker software

4. Scrollview and GestureDetector

5. ExpandableListView with ResourceCursorAdapter problem

6. Question about long pressed

7. Intel Drops an 鈥楢tom` Brand