java - Extending an EditText View in Android: Not letting me use my custom methods. why? -
whenever I see it in my MainActivity class, it's okay to do so, so I make my own edit by the EditText view Trying to expand, but let me use the new methods I have made! Any help is appreciated! Below is my code:
// Sticky.java extends the public square sticky EditText {Personal CharSequence title = ""; Public Sticky (Reference Reference) {Super (Reference); Log D. ("Sticky constructor", "made new sticky!"); } Public Sticky (Reference Reference, AttributeSet attrs) {Super (references, attrs); } Public Sticky (Reference Reference, AttributeSet attrs, int defStyle) {Super (references, attrs, defStyle); } Public Zero Satellites (charsatta text) {this.title = text; } Public Charsequence getTitle () {this.title return; }}
I tried to use the inner squares for the first time, but that did not work much. I thought about moving it myself in a different file. Sadly, that did not work either.
// MainActivity.java Public Squad Extends MainActivity ActionBarActivity {Fixed final integer STICKY_NOTE_HEIGHT = 180, STICKY_NOTE_WIDTH = 180; Editing text matched; @Override Protected Zero OnCreate (bundled savedInstanceState) {super.onCreate (savedInstanceState); SetContentView (R.layout.activity_main); MEdit = new sticky (this); MEdit.setId (1); MEdit.setTextColor (Color.BLACK); MEdit.setTextSize (24); MEdit.setHeight (STICKY_NOTE_HEIGHT); MEdit.setWidth (STICKY_NOTE_WIDTH); MEdit.setTitle ("sticky" + mEdit2.getId ()); // Error FrameLayout.LayoutParams parameter = new FrameLayout.LayoutParams (FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT); Params.setMargins (sticky note late margin, sticky note, tapa margin, 0, 0); FrameLayout.addView (mEdit2, parameter); // Add a new view and use new layout rules}
When I run the app with mEdit.setTitle ();
Commented, works perfectly well The only problem occurs when I try to delete it and try the custom method created in the Sticky.java file. Error Android Studio gives me error: (93, 23) Error: Icons method can not be set (string)
. I looked completely for the answer but there is no benefit. Can anyone tell me what I am doing? This is probably something very simple and I am just looking at it: (
Instead:
try mEdit.setTitle (); // error
Try:
mEdit.setTitle ("a random title") ;
Comments
Post a Comment