Hoon222y

[문제해결] - You need to use a Theme.AppCompat theme (or descendant) with this activity. 본문

개발 /우리 지금 만나

[문제해결] - You need to use a Theme.AppCompat theme (or descendant) with this activity.

hoon222y 2017. 12. 5. 18:18

 채팅창을 구현하는 과정에 저런 오류가 발생하였다. 

해결책은 구현할 때 extends Activity로 받아주면 된다. 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class ChatMode extends Activity {
 
    private ListView lv;
    private MyAdapter mAdatper;
    private ArrayList<listItem> list;
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        //listItem 클래스 : ListView의 아이템에 본인이 넣고자 하는 데이터들의 묶음
        list=new ArrayList<listItem>();     // ArrayList로 생성
        lv=(ListView)findViewById(R.id.lv); // listview의 아이디 값을 받아오고
        mAdatper=new MyAdapter(list);       // Adapter 생성
        lv.setAdapter(mAdatper);            // Adapter에 붙인다
}
 
cs


Comments