Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

A Non-static method cannot be referenced from a static context error

Asked by Ankesh Kumar Jul 14, 2021 1.2K views 1 answer
Share

About this question

Getting an error when inserting String value from R.string resource XML file:

public static final String TT =  (String) getText(R.string.TT);

This is the error message:

Error: Cannot make a static reference to the non-static method getText(int) from the type Context

How do you fix non-static method Cannot be referenced from a static context Java?

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.