2013-05-06 36 views
0

我想產生一個動態表有問題它的正常工作上面API> 11,但其表示這樣表視圖給錯誤11

05-06 12:35:30.303: E/AndroidRuntime(386): FATAL EXCEPTION: main 
05-06 12:35:30.303: E/AndroidRuntime(386): java.lang.NoClassDefFoundError: android.app.ActionBar$LayoutParams 
05-06 12:35:30.303: E/AndroidRuntime(386): at com.ica.icacounselor.Follow_ups_list_third_level.populateTable(Follow_ups_list_third_level.java:105) 
05-06 12:35:30.303: E/AndroidRuntime(386): at com.ica.icacounselor.Follow_ups_list_third_level.onCreate(Follow_ups_list_third_level.java:65) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.os.Handler.dispatchMessage(Handler.java:99) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.os.Looper.loop(Looper.java:123) 
05-06 12:35:30.303: E/AndroidRuntime(386): at android.app.ActivityThread.main(ActivityThread.java:3683) 
05-06 12:35:30.303: E/AndroidRuntime(386): at java.lang.reflect.Method.invokeNative(Native Method) 
05-06 12:35:30.303: E/AndroidRuntime(386): at java.lang.reflect.Method.invoke(Method.java:507) 
05-06 12:35:30.303: E/AndroidRuntime(386): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
05-06 12:35:30.303: E/AndroidRuntime(386): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
05-06 12:35:30.303: E/AndroidRuntime(386): at dalvik.system.NativeStart.main(Native Method) 

我的代碼如下

//-------------------------------------------------------------------------------------------------- 
    // Creating Table Header 
    //-------------------------------------------------------------------------------------------------- 

    TableRow followup_tr_head = new TableRow(this); 
    followup_tr_head.setId(10); 
    followup_tr_head.setBackgroundResource(R.drawable.list_header); 
    followup_tr_head.setLayoutParams(new LayoutParams(
      LayoutParams.FILL_PARENT, 
      LayoutParams.WRAP_CONTENT)); 


    final TextView time_name_title = new TextView(this); 
    time_name_title.setId(20); 
    time_name_title.setText("Time"); 
    time_name_title.setTextColor(Color.WHITE); 
    time_name_title.setPadding(5,5,5,5); 
    followup_tr_head.addView(time_name_title);// add the column to the table row here 
    time_name_title.setTextSize(12);  

    final TextView student_name_title = new TextView(this); 
    student_name_title.setId(20); 
    student_name_title.setText("Student Name"); 
    student_name_title.setTextColor(Color.WHITE); 
    student_name_title.setPadding(5,5,5,5); 
    followup_tr_head.addView(student_name_title);// add the column to the table row here 
    student_name_title.setTextSize(12);  
+0

我不明白這個問題。您在11歲以前的目標中使用11後api元素,並且您遇到問題。人們會期望,不是嗎? – njzk2 2013-05-06 07:25:24

回答

2
一些錯誤

ActionBar在API 11中提供。您不能在較低的API級別使用它。

1

是的,你不能使用下面的ActionBar API級別11 要在較低API級別使用ActionBarSherlock

+0

添加已提供的答案有什麼? – 2013-05-06 07:30:21

+3

那麼,他至少重定向到一個網站,這將使該職位的所有者想到夏洛克動作吧 – CRUSADER 2013-05-06 07:32:12

0

我已經進口了進口android.app.ActionBar.LayoutParams使用動作條;

我應該import android.widget.TableRow.LayoutParams;