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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:55:12+00:00 2026-05-28T20:55:12+00:00

On my Android project I have the main Activity called TestFIO , which is

  • 0

On my Android project I have the main Activity called TestFIO, which is in the package org.testing.file.io.main, and I tried to keep it clear and sent all the functions I had to a new class called FileManipulator, which is located at org.testing.file.io.main.manipulator. Here is how the FileManipulator class looks like:

package org.testing.file.io.main.manipulator;

// imports here

public class FileManipulator extends TestFIO {
    public String readFileFromCard(String location) {
        // some code here
    }

    // more functions here
}

And here is an example of TestFIO:

// header with package and imports

import org.testing.file.io.main.manipulator.FileManipulator;

public class TestFIO extends ListActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final String[] fileString = readFileFromCard(Environment.getExternalStorageDirectory() + "test.txt");
    }
}

The problem is that Eclipse is underlining readFileFromCard and showing the following error:

Eclipse Error Dialog

What am I doing wrong or how is the correct way to organize my code in packages?

PS: Sorry if this is a dumb question, I’m coming from iOS development.

  • 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-28T20:55:13+00:00Added an answer on May 28, 2026 at 8:55 pm

    The compile problem is because you’re trying to call a method defined in a subclass from the superclass. Inheritance doesn’t work that way; subclasses inherit all public and protected methods from the superclass, but superclasses don’t know anything about the methods of their subclasses.

    Additionally, it doesn’t seem reasonable to have FileManipulator extend your Activity class. Does FileManipulator pass the “is-a” test, in other words, is it a kind of Activity? It seems more like it’s a “helper” class that the Activity will use to do its work. In that case, FileManipulator should not extend TestFIO but rather be stand-alone, created by TestFIO.

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

Sidebar

Related Questions

I have a JSON file which is populated to an activity (Main.java). This Activity
I have an Android test project in which I test my main application. The
package com.android.project; import android.app.Activity; import android.os.Bundle; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE;
I have Android pet-project DroidIn which utilizes HttpClient 4 (built into Android) to do
I have main activity which call other object, for example GPS class. This GPS
I have an Android Project called Hello on my Ubuntu 10.04 i386 Server (headless).
i am using Facebook sdk in my android project and in my main activity
I have created a custom class for my Android project called Sounds I want
Literally all I have done is create a new project. import android.app.Activity; import android.content.ContentResolver;
I have a Android project for SDK1.5 and now I want to convert it

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.