Can anyone explain what does this dollar sign in here mean?

Viewed 59

<fragment android:name="com.example.android.quakereport.SettingsActivity$EarthquakePreferenceFragment" . . . </fragment> Here, the (SettingActivity) and the (EarthquakePreferenceFragment) are any classes in java.

Can anyone tell me what is the use if $ in here ???

2 Answers

It means EarthquakePreferenceFragment is an inner class of SettingsActivity.

It means an inner static class. In your example it would be as next:

public class SettingsActivity extends AppCompatActivity {
   
  .... other activity code ....


   // Inner class

   public static class EarthquakePreferenceFragment extends Fragment {

     .......
   }
}
Related