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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:41:44+00:00 2026-06-04T10:41:44+00:00

I believe I have a simple question…. but for me as beginner, I can’t

  • 0

I believe I have a simple question…. but for me as beginner, I can’t see it anymore.

In a class I want to get some var’s from another class.

class 1:

package com.blabla;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class SMSReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    //get shared preferences

    GetSettings test1 = new RingSettings();
    String theSMStext = test1.getSMStext();
    Boolean theActivateSMS = test1.getActivateSMS();    
}
}

class 2:

package com.blabla;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class GetSettings {

/**
 * @param args
 */
private String SMStext;
private Boolean ActivateSMS;


public static void RingSettings(Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);

    String SMStext = sp.getString("SMStext", "0");
    Boolean ActivateSMS = sp.getBoolean("ActivateSMS", false);
}

public String getSMStext(){
    return SMStext;
}

public Boolean getActivateSMS(){
    return ActivateSMS;
}
}

Eclipse is giving me in class1 “RingSettings can’t resolved to a type” => at GetSettings test1 = new RingSettings();

What I’m doing wrong?!

  • 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-04T10:41:45+00:00Added an answer on June 4, 2026 at 10:41 am

    You definitly have a few things to fix here.

    • RingSettings as defined in GetSettings returns type void not a GetSettings object.
    • RingSettings is defined to take a context as an argument.
    • RingSettings is defined as a method of a GetSettings object and should be called with GetSettings.RingSettings(context)
    • assuming you are trying to create a GetSettings object… GetSettings should have a constructor

    These are just a few to get started. I don’t mean to be rude here but you should be playing with some simpler examples to better learn the basics of Java. That being said, if you fix the above problems and repost your code someone should be able to get you closer to what your trying to accomplish.

    Check out this info on the new keyword: (to get you started)

    The new operator instantiates a class by allocating memory for a new object and returning a reference to that memory. The new operator also invokes the object constructor.

    Good luck

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

Sidebar

Related Questions

I believe this is a fairly simple question but I have no idea where
I have a question that's so simple I cannot believe I can't answer it
I believe this may be a simple question, but I've looked everywhere and tried
I have what I believe to be an embarrassingly simple problem, but three hours
I have such a simple question, I feel stupid for asking it. I can't
Simple question I believe for anyone with minimal php skills (which I don't have
Hey guys, (relatively, I believe) simple question here, I have a UITableViewController with its
This seems like it should have a simple solution but I can't seem to
This is about as beginner as a question gets, but I can't find anything
I have, I believe, a simple problem, but I don't know how to solve

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.