我正在尝试缓存列表视图中包含的Drawable对象:
我在适配器内有以下内容:
private final ImageThreadloader imageloader=new ImageThreadloader();
public View getView(int position, View convertView, ViewGroup parent)
{
View row=convertView;
ViewWrapper wrapper=null;
Activity activity=(Activity)getContext();
RssItem item=getItem(position);
if (row == null) {
LayoutInflater inflater=activity.getLayoutInflater();
row=inflater.inflate(R.layout.row,null);
wrapper=new ViewWrapper(row);
row.setTag(wrapper);
}
else
{
wrapper=(ViewWrapper)row.getTag();
}
wrapper.getTitle().setText(item.getTitle());
String cleaned=item.getDescription().replaceAll("\\<.*?\\>", "");
int Long=cleaned.length();
if (Long<=100)
{
wrapper.getDescription().setText(cleaned);
}
else wrapper.getDescription().setText(cleaned.substring(0, 50)+"...");
String laurl=item.getImageUrl();
if (laurl!="")
{
imageloader.loadImage(laurl, (ImageView)wrapper.getImage());
}
else
{
wrapper.getImage().setImageResource(R.drawable.icon);
}
return row;
}
static class ViewWrapper {
private View base;
private TextView title=null;
private …Run Code Online (Sandbox Code Playgroud) 我正在使用GWT创建一个简单的应用程序,让教师可以轻松创建自己的课程.
该应用程序将在Google App Engine上,但我希望将课程存储在用户的Google文档空间中.
可能吗?
据我所知gwt将java转换为javascript但google docs api是java,我是否必须将java库上传到de app引擎存储?
任何地方开始?任何建议?
谢谢...
我在Treasure Quest工作,引导用户通过一个ruote.我在地图中显示当前位置时遇到问题,其中也显示了任务点
我扩展了ItemizedOverlay
public class QuestItemizedOverlay extends ItemizedOverlay<OverlayItem> {
private ArrayList<OverlayItem> mOverlays= new ArrayList<OverlayItem>();
public QuestItemizedOverlay(Drawable defaultmarker) {
super(boundCenterBottom(defaultmarker));
populate();
}
@Override
protected OverlayItem createItem(int i) {
return mOverlays.get(i);
}
public void addOverlay(OverlayItem overlay) {
mOverlays.add(overlay);
populate();
}
public void removeItem(int index) {
mOverlays.remove(index);
populate();
}
@Override
public int size() {
return mOverlays.size();
}
}
Run Code Online (Sandbox Code Playgroud)
当我的位置改变时,我得到了听众:
private final LocationListener locationlistener= new LocationListener() {
public void onLocationChanged(Location location) {
Log.i("LOCATION_UPDATED","");
updateWithNewLocation(location);
mapview.invalidate();
}
public void onProviderDisabled(String provider) {
}
public void …Run Code Online (Sandbox Code Playgroud) 我花了很多时间测试方向更改,返回,再次更改等等.检查片段是否正确加载..
有没有人想过测试这些问题或使用工具的过程?
谢谢