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

The Archive Base Latest Questions

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

This is important: using tabbed activity (deprecated) everything works fine with my code, this

  • 0

This is important: using tabbed activity (deprecated) everything works fine with my code, this problem only comes when I use fragments.
I have three tabs, where each tab is a fragment. Layout is the same for every tab:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<GridView android:id="@+id/newsView"
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:verticalSpacing="2dp"
    android:numColumns="auto_fit"
    android:gravity="center"
    android:columnWidth="100dp"
    android:layout_marginTop="4dp"
    android:layout_marginBottom="4dp"
    android:layout_weight="1"/>

 </LinearLayout>

Difference is for cursor loader’s query.
Each fragment, indeed, implements LaderCallbacks:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    if(container == null)
        return null;

    View v = inflater.inflate(R.layout.activity_grid, container,false);
    dataSource = new MyCursorAdapter(getActivity().getApplicationContext(), null);
    GridView grid = (GridView)v.findViewById(R.id.newsView);
    grid.setAdapter(dataSource);
   getActivity().getSupportLoaderManager().initLoader(LOADER_ID, null, this);

    return v;

and for the rest of the code (cursor query for example) I’m 100% sure, as it worked before switching to fragments.
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-06-11T12:48:03+00:00Added an answer on June 11, 2026 at 12:48 pm

    Solved…it was just another programming error, nothing wrong with the code posted..sorry!

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

Sidebar

Related Questions

Im using this code: $(this).css('backgroundcolor', localStorage.getItem('bgColorr') + !important;); When i write: alert( localStorage.getItem('bgColorr') +
I have this simple code (for making things shorted, the important bits are probably
First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built
This question regards unit testing in Visual Studio using MSTest (this is important, because
I'm using PHP5 and MySQL, everything is fine until more than 9,000 petitions are
Screenshot Important Note : This application does not support Internet Explorer. I will be
Important : Please see this very much related question: Return multiple values in C++
I found this post useful and important to share, so if anybody has problems
I know this question is not really important.. however I've been wondering: Which of
This is kinda....a two part question. The first one is much more important than

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.