Answer the question
In order to leave comments, you need to log in
Why does an Android app compile error occur?
As I suppose you need to use this but I can't figure out how to do it
package com.rgapp;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class ServerCard extends RelativeLayout {
TextView textViewTitle;
TextView textViewValue;
ImageView imageView;
String Name;
public ServerCard(Context context) {
super(context);
init(context);
}
public ServerCard(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public ServerCard(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
private void init(Context context) {
View.inflate(context, R.layout.servercard, this);
setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);
textViewTitle = (TextView) findViewById(R.id.textViewTitle);
textViewValue = (TextView) findViewById(R.id.textViewValue);
imageView = (ImageView) findViewById(R.id.imageView);
}
public void setTitleText(String text) {
textViewTitle.setText(text);
}
public void setValueText(String text) {
textViewValue.setText(text);
}
}
error: cannot find symbol
textViewTitle = (TextView) findViewById(R.id.textViewTitle);
^
symbol: variable textViewTitle
location: class id
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question