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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:49:06+00:00 2026-05-31T02:49:06+00:00

In my app I switch the view of two different graphs. The first time

  • 0

In my app I switch the view of two different graphs. The first time is the graph is drawn looks perfect, but when I go to the other one and come back looks like it draws two times the same graph but in different sizes and as soon as you click the graph it changes and looks perfect.

The screen when it looks wired is:

The screen when it looks wired is:

The code that draws the graph is always the same. This function is:

private void downloadInfo(String app, String object) {
    // Display flow graph
    //
    String query = "Select name from relation where obj_app = '" + app
            + "' and obj_name = '" + object
            + "' and obj_type = 1 and type= 22";
    String data = "name";
    String comparateur = new DataBaseAccess().execute(query, data);
    String compAux[] = comparateur.split("&");
    query = "Select * from data_1h where app = '" + app
            + "' and obj_name = '" + compAux[0] + "' and obj_type= 22";
    String file = new DataBaseAccess().execute(query, "file-date");
    String[] fileAux = file.split("&");
    date = fileAux[1];
    GraphicalView mChartView = new DebitGraph().execute(ShowGraph.this,
            fileAux[0], fileAux[1], compAux[0], object);
    RelativeLayout layout = (RelativeLayout) findViewById(R.id.graph1);
    layout.removeAllViews();
    Display display = getWindowManager().getDefaultDisplay();
    RelativeLayout.LayoutParams paramsForChart1 = new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT,
            ViewGroup.LayoutParams.FILL_PARENT);
//  paramsForChart1.bottomMargin = 25;
    layout.addView(mChartView, paramsForChart1);
    // Display Meteo graph
    query = "Select name from relation where obj_app = '" + app
            + "' and obj_name = '" + object
            + "' and obj_type = 1 and type= 20";
    data = "name";
    String station = new DataBaseAccess().execute(query, data);
    String stationAux[] = station.split("&");
    query = "Select * from data_1h where app = '" + app
            + "' and obj_name = '" + stationAux[0] + "' and obj_type= 20";
    data = "file-date";
    file = new DataBaseAccess().execute(query, data);
    fileAux = file.split("&");
    GraphicalView mChartView2 = new Meteo().execute(ShowGraph.this,
            fileAux[0], fileAux[1], stationAux[0], prec, temp);
    RelativeLayout.LayoutParams paramsForChart2 = new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT,
            ViewGroup.LayoutParams.FILL_PARENT);
    layout = (RelativeLayout) findViewById(R.id.graph2);
    layout.removeAllViews();
//  paramsForChart2.bottomMargin = 25;
    layout.addView(mChartView2, paramsForChart2);

    // Display check boxes for temperature and precipitation
    RelativeLayout check = (RelativeLayout) findViewById(R.id.checks);
    check = (RelativeLayout) findViewById(R.id.checks);
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    LinearLayout checkbox = (LinearLayout) inflater.inflate(
            R.layout.checkboxes, null);
    check.addView(checkbox);

    // Update text bar text with meteo info
    /*
     * TextView meteo = (TextView) findViewById(R.id.meteo);
     * meteo.setText("Méteo " + stationAux[0] + " " + fileAux[1]);
     * meteo.setTextColor(Color.BLACK); meteo.setTextSize(14);
     */
    if (MyDialog.isShowing()) {
        MyDialog.dismiss();
    }
}

I have alse changed the achartengine library as to change the zoom buttons but nothing else!

In my logCat I get this warning each time the screen goes crazy:

03-13 12:01:16.767: W/InputManagerService(229): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@2b1fb958

I’ve been looking this error in the forum but any of the answers I’ve found are usefull!

For more info, looks like I have the same problem as this post:

Achartengine: graph redraw on top of normal graph

But when I comment my onResume() the problem don’t disappear!

Any ideas?
Thanks!

  • 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-31T02:49:08+00:00Added an answer on May 31, 2026 at 2:49 am

    When you return to the chart view, you may need to call a repaint() on it.

    Another way to avoid such screen artifacts would be to call renderer.setInScroll(true);

    Dan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created an app with two different calculator views, each one with a separate
I have UINavigationController based app with two views. On the first view there is
I have two views in one XIB I want to switch, but I don't
I am trying to make an app with two different tab bar controllers, one
My app has two tabs, one of which is a table view, in the
I need to switch among 3 different environments when developing my web app -
I added a navigation control to switch between views in my app. But some
I'm working on a cocoa-touch app using OpenAL, but I'm willing to switch to
I just implemented the onClickListener. The App should switch between two layouts. On each
I have two views of some data: a list view (a ListBox now, but

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.