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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:45:05+00:00 2026-05-31T11:45:05+00:00

I’ve released an app, and I recently found out that its not working 100%

  • 0

I’ve released an app, and I recently found out that its not working 100% correctly in a foreign language (French to be exact).

It appears it works correctly until I create a cursor from a database and manipulate my returned data. I have text views that either gray out with default text, or it populates with what is returned from the cursor. What is happening is that it is doing neither of those things, and instead just uses the text that is in the layout I created.

Here is the code:

Cursor item = mDbHelper.fetchItem(mItemId);

String airline =item.getString(
                    item.getColumnIndexOrThrow(TripsDbAdapter.KEY_FIELD_FLIGHT_AIRLINE));

TextView itemAirline = (TextView)findViewById(R.id.flight_item_airline);
            if(airline==null||airline.equalsIgnoreCase("null")){

                itemAirline.setText(R.string.default_carrier);
                itemAirline.setTextColor(getResources().getColor(R.color.light_orange));
            }else{
            itemAirline.setText(item.getString(
                    item.getColumnIndexOrThrow(TripsDbAdapter.KEY_FIELD_FLIGHT_AIRLINE)));
                    //itemAirline.setTextColor(getResources().getColor(R.color.white));
            }

As you can see, I do a check to see if the database item called is null or “null” and change the text view accordingly. It doesn’t appear to be getting to that though since it doesn’t change at all. Keep in mind this has always worked perfectly when run on an English Language phone. The rest of my app seems to run fine in French as well except for this feature.

Here is my Database call too in case it is needed:

public Cursor fetchItem(long itemId) throws SQLException {
        Cursor mCursor =
                mDb.query(true, DATABASE_TABLE_ITEMS, COLUMNS, KEY_ITEMID + "=" + itemId, null,
                        null, null, null, null);
        if (mCursor != null) {
            mCursor.moveToFirst();
        }
        return mCursor;
    }

UPDATE
I am getting a LogCat message of an unparseable date when I switch my phone to the French Language. The code that parses the date is:

DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);

String itemDate = item.getString(
                    item.getColumnIndexOrThrow(TripsDbAdapter.KEY_DEP_DATE));
            System.out.println("Before PArse Dates");
            Date dateObj = df.parse(itemDate);

The date in question is of format Month, day, year. So I know where the problem is happening, but I still can’t figure out why. Any ideas?

  • 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-05-31T11:45:07+00:00Added an answer on May 31, 2026 at 11:45 am

    I found that the unparseable date exception I was getting was just from incorrect formatting, and that my code was just stopping on the exception which is what caused my original problem.

    For future reference, if you want to parse something like “2012-10-05”:

    private static final String DATE_SQL = "yyyy-MM-dd";
    private static final String DATE_FORMAT = "MMM dd, yyyy";
    
    DateFormat df = new SimpleDateFormat(DATE_SQL, Utility.getLocale());
    Date dateObj = df.parse("2012-10-05");
    
    //Format it to a more user friendly date
    System.out.println(sdf.format(dateObj));   //Oct. 05, 2012
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I am writing an app with both english and french support. The app requests
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a

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.