首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解析符号页

无法解析符号页
EN

Stack Overflow用户
提问于 2016-01-28 15:23:14
回答 1查看 579关注 0票数 0

伙计们,我有代码来显示图像/可绘制的。我一直收到“无法解析符号页”的错误,我确信我把问题复杂化了,这里肯定有更简单的方法来解决这个问题。我使用的是http://www.learn-android-easily.com/2013/07/android-expandablelistview-example.html中的示例

代码语言:javascript
复制
package com.geka.deviceinsight.home;
import android.app.ExpandableListActivity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ExpandableListView;
import android.widget.TextView;
import android.support.v4.content.ContextCompat;
import com.androidquery.AQuery;
import com.xera.deviceinsight.Globals;
import com.xera.deviceinsight.R;
import android.graphics.drawable.Drawable;

import java.util.ArrayList;

/**
 * Created by timothycoutlakis on 2015/02/14.
 */
public class ExpandableListMainActivity extends ExpandableListActivity
{
   // Create ArrayList to hold parent Items and Child Items
   private Context context;
   private ArrayList<String> parentItems = new ArrayList<String>();
   private ArrayList<Object> childItems = new ArrayList<Object>();


   @Override
   public void onCreate(Bundle savedInstanceState)
   {
      super.onCreate(savedInstanceState);
      // Create Expandable List and set it's properties
      ExpandableListView expandableList = getExpandableListView();
      expandableList.setDividerHeight(2);
      expandableList.setGroupIndicator(null);
      expandableList.setClickable(true);
      // Set the Items of Parent
      setGroupParents();
      // Set The Child Data
      setChildData();
      // Create the Adapter
      myExpandableAdaptorActivity adapter = new myExpandableAdaptorActivity(parentItems, childItems);
      adapter.setInflater((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE), this);
      // Set the Adapter to expandableList
      expandableList.setAdapter(adapter);
      expandableList.setOnChildClickListener(this);
   }
   // method to add parent Items
   public void setGroupParents()
   {
      parentItems.add("Above Grade");
      parentItems.add("Acre");
      parentItems.add("A/C Circuit");
      parentItems.add("Accelerator");
      parentItems.add("Adhesion");
      parentItems.add("Adhesive Failure");
   }
   // method to set child data of each parent
   public void setChildData()
   {
      // Add Child Items for Above Grade
      ArrayList<String> child = new ArrayList<String>();
      child.add("In plaster walls, strips of metal mesh bent at right angles and embedded in corners of ceilings and walls to prevent the plaster from cracking.");
       child.add(0,String.valueOf(R.drawable.buildexpo));

       context = getApplicationContext(); Drawable drawable = ContextCompat.getDrawable(context, page.getImageId());
       getApplicationContext().getResources().getDrawable(2130837568);
      childItems.add(child);

      child = new ArrayList<String>();
      child.add("In plaster walls, strips of metal mesh bent at right angles and embedded in corners of ceilings and walls to prevent the plaster from cracking.");

      childItems.add(child);

      child = new ArrayList<String>();
      child.add("In plaster walls, strips of metal mesh bent at right angles and embedded in corners of ceilings and walls to prevent the plaster from cracking.");

      childItems.add(child);

      child = new ArrayList<String>();
      child.add("In plaster walls, strips of metal mesh bent at right angles and embedded in corners of ceilings and walls to prevent the plaster from cracking.");

      childItems.add(child);

      child = new ArrayList<String>();
      child.add("In plaster walls, strips of metal mesh bent at right angles and embedded in corners of ceilings and walls to prevent the plaster from cracking.");

      childItems.add(child);

      child = new ArrayList<String>();
      child.add("In plaster walls, strips of metal mesh bent at right angles and embedded in corners of ceilings and walls to prevent the plaster from cracking.");

      childItems.add(child);

   }
}
EN

回答 1

Stack Overflow用户

发布于 2016-01-28 15:25:23

这意味着您要么没有名为page的变量,要么它在您尝试使用它的范围内。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35055157

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档