我正在尝试研究如何开发我的第一个应用程序,但是当我尝试编译此代码时,eclipse 返回错误“构造函数意图未定义”:
package com.baruckis.SlidingMenuImplementation.FromClass;
import android.app.Activity;
import android.content.Intent;
import android.widget.Toast;
import com.baruckis.SlidingMenuImplementation.R;
import com.baruckis.SlidingMenuImplementation.SlidingMenuListItem;
import com.baruckis.SlidingMenuImplementation.prova;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
public class SlidingMenuBuilderBase {
protected Activity activity;
protected SlidingMenu menu = null;
public void createSlidingMenu(Activity activity) {
this.activity = activity;
menu = new SlidingMenu(activity);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowWidthRes(R.dimen.sliding_menu_shadow_width);
menu.setShadowDrawable(R.drawable.sliding_menu_shadow);
menu.setBehindOffsetRes(R.dimen.sliding_menu_offset);
menu.setFadeDegree(0.35f);
menu.attachToActivity(activity, SlidingMenu.SLIDING_WINDOW);
menu.setMenu(R.layout.sliding_menu_frame);
SlidingMenuListFragment slidingMenuListFragment = new SlidingMenuListFragment();
slidingMenuListFragment.setMenuBuilder(this);
activity.getFragmentManager().beginTransaction()
.replace(R.id.sliding_menu_frame, slidingMenuListFragment)
.commit();
}
public SlidingMenu getSlidingMenu() {
return menu;
}
public void onListItemClick(SlidingMenuListItem selectedSlidingMenuListItem) {
CharSequence text;
switch (selectedSlidingMenuListItem.Id) {
case R.slidingmenu.list_item_municipio_id:
Intent ii = new Intent(this, prova.class);
startActivity(ii);
finish();
break;
case R.slidingmenu.list_item_basic_id:
text = "Clicked item “"
+ selectedSlidingMenuListItem.Name
+ "”. "
+ activity
.getString(R.string.toast_sliding_menu_custom_action);
Toast.makeText(activity, text, Toast.LENGTH_LONG).show();
break;
default:
text = "Clicked item. "
+ activity
.getString(R.string.toast_sliding_menu_no_action_default);
Toast.makeText(activity, text, Toast.LENGTH_LONG).show();
break;
}
}
}
我已经尝试在其他线程中寻找解决方案,但我没有找到适合我的方法!