import com.example.zulkuf.sdukampus.fragments.DayKey;
/**
* Created by zulkuf on 24.4.2017.
*/
public class BusItemClickActivity extends AppCompatActivity{
private ImageView imClick;
public TextView tv1Click, tv2Click, tv3Click;
private String busClickTime;
private String busClickNumber;
private String busClickRoute;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bus_item_click_activity);
imClick = (ImageView) findViewById(R.id.ivBusClickNumberImage);
tv1Click = (TextView) findViewById(R.id.tvBusClickNumber);
tv2Click = (TextView) findViewById(R.id.BusClickTime);
tv3Click = (TextView) findViewById(R.id.BusClickRoute);
}
public void busInformation(String[] info){
busClickNumber = info[0].toString();
busClickTime = info[1].toString();
busClickRoute = info[2].toString();
tv1Click.setText(busClickNumber);
tv2Click.setText(busClickTime);
tv3Click.setText(busClickRoute);
}
}
答案 0 :(得分:0)
从您的评论/回答中,似乎其中一个findViewById
正在返回null
。当找不到视图时会发生这种情况。确保布局文件中的id与java代码中的id相同。