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 8541819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:55:02+00:00 2026-06-11T11:55:02+00:00

*Hi I am new to android development and I am no where a professional

  • 0

*Hi I am new to android development and I am no where a professional as you’ll soon find out, anyways here’s the problem I am having:
I have two databases, namely
1->DatabaseClass and
2->TransactionDatabase
The database DatabaseClass has an entry for bank_name field and account_number(and others, but it doesn’t matter at this point). The TransactionDatabase also has a field for bank_name and account_number.
A spinner item in transaction side holds the list of all bank_names, these names are accessed from the DatabaseClass, by using a cursor.The items selected from the spinner are stored in the TransactionDatabase.
Now the user enters the account number for that selected bank in TransactionDatabase. If that bank’s account number matches the account number added in the database ‘DatabaseClass’, all the fields contained in that “particular” row which has that “particular” account number should be picked up from both the tables and should be inserted in different strings.
How can I compare the account_numbers ?, I collected the text contained in the edit text field named ‘account number’ in the transaction side.Also a bank name from spinner is selected. Now how can I get the account number from the ‘DatabaseClass’ corresponding to that bank name, for comparison?
I used this to set up the bank name in spinner :*

    SimpleCursorAdapter myAdapter;


    Cursor cursor = myDatabase.getData();
    cursor.moveToFirst();           
    myAdapter = new SimpleCursorAdapter(AddTransaction.this,
                R.layout.spinnerlayout, cursor,
                new String[] { DatabaseClass.KEY_BANK_NAME_ID, },
                new int[] { R.id.bankName });
    mySpinner.setAdapter(myAdapter);

So far I am able to get the position of the item selected from spinner through the database DatabaseClass, please help me I am very confused.

    int item = mySpinner.getSelectedItemPosition();
    Cursor cursor = myDatabase.getData();
    cursor.moveToPosition(item);
  • 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-11T11:55:03+00:00Added an answer on June 11, 2026 at 11:55 am

    Your options:

    1. Combine the two databases, use separate tables inside one database
      and join the tables on the foreign_key. (Preferred)
    2. Subclass cursor adapter to take multiple cursors.
    3. Create a custom class that implements cursor and stores references to both and create a custom helper class that access both tables to populate it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to android development and I have been having issues with Force
I am New Android development. In My application I have two ArrayLists. One ArrayList
I am new to Android development. I have both Windows 7 and Mac OS
I am somewhat new to android development and development in general. I have a
I'm new to Android development. My OS is WinXP. I'm trying to install two
I am new to android development. I have created a popup window which is
I am very new to Android development and Java. Have read around but I'm
I'm new to Android development and am having an issue with my first app's
I am new to android development and I have a question about the insert
I am new to android development but in the past few weeks I have

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.