Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android中搜索ListView项目,始终打开ListView的第一个项目_Android_Listview_Android Fragments_Android Listview - Fatal编程技术网

在Android中搜索ListView项目,始终打开ListView的第一个项目

在Android中搜索ListView项目,始终打开ListView的第一个项目,android,listview,android-fragments,android-listview,Android,Listview,Android Fragments,Android Listview,我正在尝试对我的应用进行列表视图搜索。我发现很多教程都是这样做的,搜索栏放在顶部,如果你在框中键入,结果会被过滤 但当我单击搜索的项目时,它打开的是ListView的第一个项目,而不是搜索的项目。搜索成功,但单击筛选结果时,它始终显示listview的第一项。当listview未处于过滤模式时,它工作正常 在我的应用程序中,我想在过滤完成后单击给定的项目,我已经实现了setOnItemClickListener 请帮忙 这是我的密码: 片段A,我在其中实现了listview public cla

我正在尝试对我的应用进行列表视图搜索。我发现很多教程都是这样做的,搜索栏放在顶部,如果你在框中键入,结果会被过滤

但当我单击搜索的项目时,它打开的是ListView的第一个项目,而不是搜索的项目。搜索成功,但单击筛选结果时,它始终显示listview的第一项。当listview未处于过滤模式时,它工作正常

在我的应用程序中,我想在过滤完成后单击给定的项目,我已经实现了setOnItemClickListener

请帮忙

这是我的密码:

片段A,我在其中实现了listview

public class FragmentAwarenessA extends Fragment implements
        OnItemClickListener, SearchView.OnQueryTextListener {

    ListView list;
    Communicator communicator;
    SearchView searchview;



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        View view = inflater.inflate(R.layout.fragment_awareness_a, container,
                false);
        list = (ListView) view.findViewById(R.id.listView1);
        searchview = (SearchView) view.findViewById(R.id.etSearch);
        ArrayAdapter adapter = ArrayAdapter.createFromResource(getActivity(),
                R.array.diseases, android.R.layout.simple_list_item_1);
        list.setAdapter(adapter);
        list.setOnItemClickListener(this);
        list.setTextFilterEnabled(true);

        searchview.setOnQueryTextListener(this);

        return view;
    }

    public void setCommunicator(Communicator communicator) {
        this.communicator = communicator;
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position,
            long id) {
        // TODO Auto-generated method stub

        communicator.respond(position);
        // communicator.click();

    }

    public interface Communicator {

        public void respond(int index);

        // public void click();
    }

    @Override
    public boolean onQueryTextSubmit(String query) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean onQueryTextChange(String newText) {
        // TODO Auto-generated method stub
        if (TextUtils.isEmpty(newText)) {
            // clear text filter so that list displays all items
            list.clearTextFilter();

        } else {
            // apply filter so that list displays only
            // matching child items
            list.setFilterText(newText.toString());

        }
        return true;

    }

}
以下是我的主要活动,它充当两个片段之间的通信管道:

public class FriendsActivity extends Activity implements
        FragmentAwarenessA.Communicator {

    FragmentAwarenessA f1;
    FragmentAwarenessB f2;
    FragmentManager manager;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_awareness);

        manager = getFragmentManager();
        f1 = (FragmentAwarenessA) manager.findFragmentById(R.id.fragment1);
        f1.setCommunicator(this);
    }

    @Override
    public void respond(int index) {
        // TODO Auto-generated method stub
        f2 = (FragmentAwarenessB) manager.findFragmentById(R.id.fragment2);
        if (f2 != null && f2.isVisible()) {

            f2.ChangeData(index);

        } else {

            Intent intent = new Intent(this, AwarenessActivityLand.class);
            intent.putExtra("index", index);
            startActivity(intent);

        }
    }

}
最后是包含所有数组的strings.xml文件:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="hello">Hello World, AndroidDashboardDesignActivity!</string>
    <string name="app_name">Health Care</string>

    <string-array name="diseases">
        <item>Anxiety disorder</item>
        <item>Asthma</item>
        <item>Cellulitis (skin infection)</item>
        <item>Depression (excessive sadness)</item>
        <item>Diabetes (high blood sugar)</item>
        <item>High cholesterol (hypercholesteremia)</item>
        <item>Hypertension (high blood pressure)</item>
        <item>Influenza (seasonal flu)</item>
        <item>Kidney stone (nephrolithiasis)</item>
        <item>Obesity</item>
        <item>Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Dheadings">
        <item>Description of Anxiety disorder</item>
        <item>Description of Asthma</item>
        <item>Description of Cellulitis (skin infection)</item>
        <item>Description of Depression (excessive sadness)</item>
        <item>Description of Diabetes (high blood sugar)</item>
        <item>Description of High cholesterol (hypercholesteremia)</item>
        <item>Description of Hypertension (high blood pressure)</item>
        <item>Description of Influenza (seasonal flu)</item>
        <item>Description of Kidney stone (nephrolithiasis)</item>
        <item>Description of Obesity</item>
        <item>Description of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Sheadings">
        <item>Symptoms of Anxiety disorder</item>
        <item>Symptoms of Asthma</item>
        <item>Symptoms of Cellulitis (skin infection)</item>
        <item>Symptoms of Depression (excessive sadness)</item>
        <item>Symptoms of Diabetes (high blood sugar)</item>
        <item>Symptoms of High cholesterol (hypercholesteremia)</item>
        <item>Symptoms of Hypertension (high blood pressure)</item>
        <item>Symptoms of Influenza (seasonal flu)</item>
        <item>Symptoms of Kidney stone (nephrolithiasis)</item>
        <item>Symptoms of Obesity</item>
        <item>Symptoms of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Cheadings">
        <item>Causes of Anxiety disorder</item>
        <item>Causes of Asthma</item>
        <item>Causes of Cellulitis (skin infection)</item>
        <item>Causes of Depression (excessive sadness)</item>
        <item>Causes of Diabetes (high blood sugar)</item>
        <item>Causes of High cholesterol (hypercholesteremia)</item>
        <item>Causes of Hypertension (high blood pressure)</item>
        <item>Causes of Influenza (seasonal flu)</item>
        <item>Causes of Kidney stone (nephrolithiasis)</item>
        <item>Causes of Obesity</item>
        <item>Causes of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Theadings">
        <item>Treatment of Anxiety disorder</item>
        <item>Treatment of Asthma</item>
        <item>Treatment of Cellulitis (skin infection)</item>
        <item>Treatment of Depression (excessive sadness)</item>
        <item>Treatment of Diabetes (high blood sugar)</item>
        <item>Treatment of High cholesterol (hypercholesteremia)</item>
        <item>Treatment of Hypertension (high blood pressure)</item>
        <item>Treatment of Influenza (seasonal flu)</item>
        <item>Treatment of Kidney stone (nephrolithiasis)</item>
        <item>Treatment of Obesity</item>
        <item>Treatment of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="description">
        <item>A psychological disorder in which anxiety is so severe they prevent a person from performing their normal daily activities.</item>
        <item>An inflammatory disease of the lungs characterized by reversible airway obstruction.</item>
        <item>A skin infection usually caused by bacteria. Bacteria can enter into the skin either through a cut or insect bite and spread to deeper tissues causing an infection.</item>
        <item>A mental state or chronic psychiatric disorder characterized by excessive feelings of sadness, loneliness, despair, helplessness, low self-esteem, and self-reproach. Depression is different than normal sadness because it prevents the person from functioning normally in their daily life.</item>
        <item>A chronic disease of metabolism distinguished by the body\'s inability to produce enough insulin, and/or a resistance to the insulin being made. There are three types of diabetes: Type 1 is usually found in younger patients and requires insulin, Type 2 develops later in life and is more commonly associated with obesity.</item>
        <item>Elevated levels of cholesterol in the blood increases the risk of having narrowed arteries. The blockage is caused by a buildup of plaque and fat deposits (atherosclerosis).</item>
        <item>A termed used for high blood pressure. There are two numbers with the first number representing the systolic pressure (normal less than 140) and the second number the diastolic (normal if less than 90). Hypertension usually causes no symptoms but is a major risk factor for a number of serious long term problems including heart attacks, stroke and kidney failure.</item>
        <item>A common, viral respiratory infection. It is contagious with an incubation period of 24 to 48 hours after exposure.</item>
        <item>Kidney stones are small, solid particles that form in one or both kidneys. The majority of kidney stones contain calcium oxalate. Other types of stones contain uric acid, struvite, and cystine.</item>
        <item>Defined as an increase in total body fat, or at least a 20% increase in one\'s ideal body weight.</item>
        <item>Sinusitis is the inflammation or infection of the sinuses. The sinuses are cavities in the facial portion of the skull, and lined by mucosa.</item>
    </string-array>
    <string-array name="symptoms">
        <item>Fear, apprehension, muscle tension, restlessness, palpitations, rapid breathing, jitteriness, hyper vigilance, confusion, decreased concentration, fear of losing control.</item>
        <item>Shortness of breath, wheezing, cough, low oxygen, fainting.</item>
        <item>The affected skin becomes painful, red, warm to the touch, and swollen. If the surrounding lymph channels become infected red streaks up the arm or leg will be seen. These red streaks are called lymphangitis. Patients may also experience fever and fatigue.</item>
        <item>Patients suffering from the following symptoms may have depression: excessive sadness, problems falling asleep, sleeping too much, problems concentrating, uncontrollable negative thoughts, no appetite, short temper, feeling helpless, increase in drinking alcohol, increase reckless behavior, increased fatigue, thoughts life isn\'t worth living.</item>
        <item>Increased urination, increased drinking of fluids, increased appetite, nausea, fatigue, blurry vision, numbness or tingling in the feet.</item>
        <item>There are usually no symptoms related to having elevated cholesterol.</item>
        <item>Usually none. If the level is very high the following may be experienced: chest pain, headache, shortness of breath, confusion.</item>
        <item>Fever, headache, tiredness (fatigue), chills, dry cough, sore throat, stuffy and congested nose, muscle aches and stiffness.</item>
        <item>Flank, back and or abdominal pain; pain often radiates to the groin: abnormal urine color, blood in the urine; nausea, vomiting; painful urination; urinary frequency/urgency, urinary hesitancy.</item>
        <item>Most of the symptoms of obesity come from the diseases obesity causes such as arthritis, heart disease, gallstones, sleep apnea, and poor self-esteem. These symptoms include: back pain, hip pain, knee pain, ankle pain, neck pain, chest pain, breathing problems, sadness, depression, snoring, rashes in the folds of the skin, and excessive sweating.</item>
        <item>Pain in the face, cough, fatigue, fever, headache, pain behind the eyes, toothache, facial tenderness, nasal congestion and discharge, sore throat, postnasal drip.</item>
    </string-array>
    <string-array name="causes">
        <item>Stressful events can also trigger symptoms of anxiety. Common triggers include: job stress or job change, change in living arrangements, family and relationship problems, major emotional shock following a stressful or traumatic event, death or loss of a loved one.</item>
        <item>No one quite understands what causes asthma, but research has shown that environmental allergens can cause asthma symptoms. These allergens are called “triggers” and include: Pollen, Pet dander, Viral upper respiratory infections, Acid reflux, Sulfites found in food and drinks, Cigarette smoke, Air pollution, Dust.</item>
        <item>Cellulitis is usually caused by bacteria that enter the body through a break in the skin. The bacteria most commonly responsible for cellulitis are staphylococci (staph) and streptococci (strep).</item>
        <item>Depression has many possible causes, including faulty mood regulation by the brain, genetic vulnerability, stressful life events, medications, and medical problems. It’s believed that several of these forces interact to bring on depression.</item>
        <item>Diabetes are caused by problems with the pancreas, an organ in the abdomen. The pancreas is located behind and below the stomach and has cells within it called islet cells. When a person eats, these cells normally produce insulin, a hormone that converts the glucose (sugar) from food into energy.</item>
        <item>High cholesterol comes from a variety of sources, including your family history and what you eat. Here are some factors: Your diet, Your weight, Your activity level, Your age and gender, Your overall health, Your family history and Cigarette smoking. </item>
        <item>There are two types of hypertension: primary or essential hypertension, and secondary or identifiable hypertension. People are diagnosed with primary hypertension when there is no clear explanation for their high blood pressure. Secondary hypertension is caused by another medical condition, such as diabetes or kidney disease.</item>
        <item>Influenza is caused by a family of viruses. The virus is usually transmitted through the air. When an infected person coughs, sneezes or talks, he or she can emit infected droplets. Flu viruses can also be spread by direct personal contact.</item>
        <item>Kidney stones are caused by high levels of certain minerals in the urine such as calcium, oxalate and uric acid. Some foods may cause kidney stones in certain people.</item>
        <item>There are many causes of obesity from genetic to environmental factors, and certain conditions including Cushing\'s syndrome, hypothyroidism and medications, such as steroids, can cause obesity. In the great majority of cases no secondary cause is determined.</item>
        <item>Allergies and the common cold are the most frequent causes of sinus infection. Infected teeth, fungal infections, nasal polyps and a deviated septum can also cause a sinus infection, although these cases are less common.</item>
    </string-array>
    <string-array name="treatment">
        <item>Therapy depends on the severity of symptoms. Treatment may include: benzodiazepines (diazepam/Valium, lorazepam/Ativan), antidepressant medications, psychological counseling, and/or psychological treatment such as cognitive-behavioral therapy.</item>
        <item>Asthma is a chronic (long term) condition that has no cure. Asthma treatment is designed to: Control symptoms, Lower the need for quick-relief medicines (like inhalers), Help you keep your lungs healthy and functioning normally, Help you maintain the ability to perform day-to-day activities, Help you get a good night’s sleep, Help you avoid asthma attacks that could lead to an emergency room visit.</item>
        <item>Cleaning and bandaging of any lacerations or abrasions will be done. Removal of the stinger will be performed if the infection is from an insect bite.</item>
        <item>Antidepressants and/or psychotherapy are the mainstays of treatment. Psychiatric hospitalizations may be needed for severe symptoms and for those with suicidal thoughts.</item>
        <item>Type 1 diabetes requires supplemental insulin either as an injection or as an intermittent continuous infusion delivered from an insulin pump. The insulin doses required are dependent on glucose measurements performed during the day. Type 2 diabetes times can often be controlled with weight loss, dietary discretion and exercise.</item>
        <item>Treatment depends on how high the LDL level is and if other risk factors for developing blockage of the arteries (atherosclerosis) are present. Eating healthy foods, exercising more, and losing weight can improve mild elevations of cholesterol.</item>
        <item>Treatment includes salt restriction, loss of excess weight, exercise and, in many cases, medications to reduce the pressure.</item>
        <item>Rest and medications to reverse the fever such as acetaminophen(Tylenol) and/or ibuprofen (Motrin, Advil) are administered to reduce the symptoms. Patients are encouraged to drink plenty of fluids.</item>
        <item>Vigorous oral or intravenous fluids, pain medications and anti-nausea medications are the primary treatments. Most stones less than 6mm in size will pass on their own. Stones that don\'t pass on their own will need to be removed during a cystoscopy or other surgical procedure.</item>
        <item>Treatment is aimed at decreasing the intake of calories while still maintaining a healthy diet, and increasing exercise.</item>
        <item>Sinusitis from allergy is treated with antihistamines, nasal sprays, decongestants or allergy shots.</item>
    </string-array>

</resources>

世界你好,AndroidDashboardDesignActivity!
保健
焦虑症
哮喘
蜂窝织炎(皮肤感染)
抑郁(过度悲伤)
糖尿病(高血糖)
高胆固醇(高胆固醇血症)
高血压(高血压)
流感(季节性流感)
肾结石(肾结石)
肥胖
鼻窦炎(鼻窦感染)
焦虑症描述
哮喘描述
蜂窝织炎(皮肤感染)的描述
抑郁描述(过度悲伤)
糖尿病(高血糖)的描述
高胆固醇(高胆固醇血症)的描述
高血压(高血压)的描述
流感描述(季节性流感)
肾结石(肾结石)的描述
肥胖的描述
鼻窦炎(鼻窦感染)的描述
焦虑症的症状
哮喘症状
蜂窝织炎症状(皮肤感染)
抑郁症状(过度悲伤)
糖尿病症状(高血糖)
高胆固醇(高胆固醇血症)症状
高血压症状(高血压)
流感症状(季节性流感)
肾结石(肾结石)症状
肥胖症状
鼻窦炎症状(鼻窦感染)
焦虑症的病因
哮喘的病因
蜂窝织炎(皮肤感染)的原因
抑郁的原因(过度悲伤)
糖尿病的原因(高血糖)
高胆固醇(高胆固醇血症)的原因
高血压的原因(高血压)
流感原因(季节性流感)
肾结石(肾结石)的病因
肥胖的原因
鼻窦炎(鼻窦感染)的原因
焦虑症的治疗
哮喘的治疗
蜂窝织炎(皮肤感染)的治疗
抑郁症(过度悲伤)的治疗
糖尿病(高血糖)的治疗
高胆固醇(高胆固醇血症)的治疗
高血压(高血压)的治疗
流感(季节性流感)的治疗
肾结石(肾结石)的治疗
肥胖的治疗
鼻窦炎(鼻窦感染)的治疗
焦虑症一种严重的心理障碍,使人无法进行正常的日常活动。
一种肺部炎症性疾病,特征为可逆性气道阻塞。
通常由细菌引起的皮肤感染。细菌可以通过伤口或昆虫叮咬进入皮肤,并传播到更深的组织,从而引起感染。
忧郁症一种精神状态或慢性精神障碍,以过度的悲伤、孤独、绝望、无助、自卑和自责为特征。抑郁症不同于正常的悲伤,因为它妨碍人们在日常生活中正常工作。
一种慢性代谢疾病,以身体不能产生足够的胰岛素和/或对所产生的胰岛素产生抵抗为特征。糖尿病有三种类型:1型糖尿病通常见于年轻患者,需要胰岛素;2型糖尿病在生命后期发展,更常见于肥胖。
血液中胆固醇水平升高会增加动脉狭窄的风险。堵塞是由斑块和脂肪堆积(动脉粥样硬化)引起的。
用于高血压的术语。有两个数字,第一个数字表示收缩压(正常值小于140),第二个数字表示舒张压(正常值小于90)。高血压通常不会引起症状,但却是许多严重长期问题的主要危险因素,包括心脏病发作、中风和肾衰竭。
一种常见的病毒性呼吸道感染。它具有传染性,接触后潜伏期为24至48小时。
肾结石是在一个或两个肾脏中形成的小的固体颗粒。大多数肾结石含有草酸钙。其他类型的结石含有尿酸、鸟粪石和胱氨酸。
定义为身体总脂肪的增加,或理想体重至少增加20%。
鼻窦炎是鼻窦的炎症或感染。鼻窦是颅骨面部的空洞,由粘膜排列。
恐惧、恐惧、肌肉紧张、不安、心悸、呼吸急促、神经过敏、高度警惕、混乱、注意力下降、害怕失去控制。
气短、喘息、咳嗽、低氧、晕厥。
受影响的皮肤变得疼痛、发红、摸起来温暖和肿胀。如果周围的淋巴道被感染,则会出现红色s
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="hello">Hello World, AndroidDashboardDesignActivity!</string>
    <string name="app_name">Health Care</string>

    <string-array name="diseases">
        <item>Anxiety disorder</item>
        <item>Asthma</item>
        <item>Cellulitis (skin infection)</item>
        <item>Depression (excessive sadness)</item>
        <item>Diabetes (high blood sugar)</item>
        <item>High cholesterol (hypercholesteremia)</item>
        <item>Hypertension (high blood pressure)</item>
        <item>Influenza (seasonal flu)</item>
        <item>Kidney stone (nephrolithiasis)</item>
        <item>Obesity</item>
        <item>Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Dheadings">
        <item>Description of Anxiety disorder</item>
        <item>Description of Asthma</item>
        <item>Description of Cellulitis (skin infection)</item>
        <item>Description of Depression (excessive sadness)</item>
        <item>Description of Diabetes (high blood sugar)</item>
        <item>Description of High cholesterol (hypercholesteremia)</item>
        <item>Description of Hypertension (high blood pressure)</item>
        <item>Description of Influenza (seasonal flu)</item>
        <item>Description of Kidney stone (nephrolithiasis)</item>
        <item>Description of Obesity</item>
        <item>Description of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Sheadings">
        <item>Symptoms of Anxiety disorder</item>
        <item>Symptoms of Asthma</item>
        <item>Symptoms of Cellulitis (skin infection)</item>
        <item>Symptoms of Depression (excessive sadness)</item>
        <item>Symptoms of Diabetes (high blood sugar)</item>
        <item>Symptoms of High cholesterol (hypercholesteremia)</item>
        <item>Symptoms of Hypertension (high blood pressure)</item>
        <item>Symptoms of Influenza (seasonal flu)</item>
        <item>Symptoms of Kidney stone (nephrolithiasis)</item>
        <item>Symptoms of Obesity</item>
        <item>Symptoms of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Cheadings">
        <item>Causes of Anxiety disorder</item>
        <item>Causes of Asthma</item>
        <item>Causes of Cellulitis (skin infection)</item>
        <item>Causes of Depression (excessive sadness)</item>
        <item>Causes of Diabetes (high blood sugar)</item>
        <item>Causes of High cholesterol (hypercholesteremia)</item>
        <item>Causes of Hypertension (high blood pressure)</item>
        <item>Causes of Influenza (seasonal flu)</item>
        <item>Causes of Kidney stone (nephrolithiasis)</item>
        <item>Causes of Obesity</item>
        <item>Causes of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="Theadings">
        <item>Treatment of Anxiety disorder</item>
        <item>Treatment of Asthma</item>
        <item>Treatment of Cellulitis (skin infection)</item>
        <item>Treatment of Depression (excessive sadness)</item>
        <item>Treatment of Diabetes (high blood sugar)</item>
        <item>Treatment of High cholesterol (hypercholesteremia)</item>
        <item>Treatment of Hypertension (high blood pressure)</item>
        <item>Treatment of Influenza (seasonal flu)</item>
        <item>Treatment of Kidney stone (nephrolithiasis)</item>
        <item>Treatment of Obesity</item>
        <item>Treatment of Sinusitis (sinus infection)</item>
    </string-array>
    <string-array name="description">
        <item>A psychological disorder in which anxiety is so severe they prevent a person from performing their normal daily activities.</item>
        <item>An inflammatory disease of the lungs characterized by reversible airway obstruction.</item>
        <item>A skin infection usually caused by bacteria. Bacteria can enter into the skin either through a cut or insect bite and spread to deeper tissues causing an infection.</item>
        <item>A mental state or chronic psychiatric disorder characterized by excessive feelings of sadness, loneliness, despair, helplessness, low self-esteem, and self-reproach. Depression is different than normal sadness because it prevents the person from functioning normally in their daily life.</item>
        <item>A chronic disease of metabolism distinguished by the body\'s inability to produce enough insulin, and/or a resistance to the insulin being made. There are three types of diabetes: Type 1 is usually found in younger patients and requires insulin, Type 2 develops later in life and is more commonly associated with obesity.</item>
        <item>Elevated levels of cholesterol in the blood increases the risk of having narrowed arteries. The blockage is caused by a buildup of plaque and fat deposits (atherosclerosis).</item>
        <item>A termed used for high blood pressure. There are two numbers with the first number representing the systolic pressure (normal less than 140) and the second number the diastolic (normal if less than 90). Hypertension usually causes no symptoms but is a major risk factor for a number of serious long term problems including heart attacks, stroke and kidney failure.</item>
        <item>A common, viral respiratory infection. It is contagious with an incubation period of 24 to 48 hours after exposure.</item>
        <item>Kidney stones are small, solid particles that form in one or both kidneys. The majority of kidney stones contain calcium oxalate. Other types of stones contain uric acid, struvite, and cystine.</item>
        <item>Defined as an increase in total body fat, or at least a 20% increase in one\'s ideal body weight.</item>
        <item>Sinusitis is the inflammation or infection of the sinuses. The sinuses are cavities in the facial portion of the skull, and lined by mucosa.</item>
    </string-array>
    <string-array name="symptoms">
        <item>Fear, apprehension, muscle tension, restlessness, palpitations, rapid breathing, jitteriness, hyper vigilance, confusion, decreased concentration, fear of losing control.</item>
        <item>Shortness of breath, wheezing, cough, low oxygen, fainting.</item>
        <item>The affected skin becomes painful, red, warm to the touch, and swollen. If the surrounding lymph channels become infected red streaks up the arm or leg will be seen. These red streaks are called lymphangitis. Patients may also experience fever and fatigue.</item>
        <item>Patients suffering from the following symptoms may have depression: excessive sadness, problems falling asleep, sleeping too much, problems concentrating, uncontrollable negative thoughts, no appetite, short temper, feeling helpless, increase in drinking alcohol, increase reckless behavior, increased fatigue, thoughts life isn\'t worth living.</item>
        <item>Increased urination, increased drinking of fluids, increased appetite, nausea, fatigue, blurry vision, numbness or tingling in the feet.</item>
        <item>There are usually no symptoms related to having elevated cholesterol.</item>
        <item>Usually none. If the level is very high the following may be experienced: chest pain, headache, shortness of breath, confusion.</item>
        <item>Fever, headache, tiredness (fatigue), chills, dry cough, sore throat, stuffy and congested nose, muscle aches and stiffness.</item>
        <item>Flank, back and or abdominal pain; pain often radiates to the groin: abnormal urine color, blood in the urine; nausea, vomiting; painful urination; urinary frequency/urgency, urinary hesitancy.</item>
        <item>Most of the symptoms of obesity come from the diseases obesity causes such as arthritis, heart disease, gallstones, sleep apnea, and poor self-esteem. These symptoms include: back pain, hip pain, knee pain, ankle pain, neck pain, chest pain, breathing problems, sadness, depression, snoring, rashes in the folds of the skin, and excessive sweating.</item>
        <item>Pain in the face, cough, fatigue, fever, headache, pain behind the eyes, toothache, facial tenderness, nasal congestion and discharge, sore throat, postnasal drip.</item>
    </string-array>
    <string-array name="causes">
        <item>Stressful events can also trigger symptoms of anxiety. Common triggers include: job stress or job change, change in living arrangements, family and relationship problems, major emotional shock following a stressful or traumatic event, death or loss of a loved one.</item>
        <item>No one quite understands what causes asthma, but research has shown that environmental allergens can cause asthma symptoms. These allergens are called “triggers” and include: Pollen, Pet dander, Viral upper respiratory infections, Acid reflux, Sulfites found in food and drinks, Cigarette smoke, Air pollution, Dust.</item>
        <item>Cellulitis is usually caused by bacteria that enter the body through a break in the skin. The bacteria most commonly responsible for cellulitis are staphylococci (staph) and streptococci (strep).</item>
        <item>Depression has many possible causes, including faulty mood regulation by the brain, genetic vulnerability, stressful life events, medications, and medical problems. It’s believed that several of these forces interact to bring on depression.</item>
        <item>Diabetes are caused by problems with the pancreas, an organ in the abdomen. The pancreas is located behind and below the stomach and has cells within it called islet cells. When a person eats, these cells normally produce insulin, a hormone that converts the glucose (sugar) from food into energy.</item>
        <item>High cholesterol comes from a variety of sources, including your family history and what you eat. Here are some factors: Your diet, Your weight, Your activity level, Your age and gender, Your overall health, Your family history and Cigarette smoking. </item>
        <item>There are two types of hypertension: primary or essential hypertension, and secondary or identifiable hypertension. People are diagnosed with primary hypertension when there is no clear explanation for their high blood pressure. Secondary hypertension is caused by another medical condition, such as diabetes or kidney disease.</item>
        <item>Influenza is caused by a family of viruses. The virus is usually transmitted through the air. When an infected person coughs, sneezes or talks, he or she can emit infected droplets. Flu viruses can also be spread by direct personal contact.</item>
        <item>Kidney stones are caused by high levels of certain minerals in the urine such as calcium, oxalate and uric acid. Some foods may cause kidney stones in certain people.</item>
        <item>There are many causes of obesity from genetic to environmental factors, and certain conditions including Cushing\'s syndrome, hypothyroidism and medications, such as steroids, can cause obesity. In the great majority of cases no secondary cause is determined.</item>
        <item>Allergies and the common cold are the most frequent causes of sinus infection. Infected teeth, fungal infections, nasal polyps and a deviated septum can also cause a sinus infection, although these cases are less common.</item>
    </string-array>
    <string-array name="treatment">
        <item>Therapy depends on the severity of symptoms. Treatment may include: benzodiazepines (diazepam/Valium, lorazepam/Ativan), antidepressant medications, psychological counseling, and/or psychological treatment such as cognitive-behavioral therapy.</item>
        <item>Asthma is a chronic (long term) condition that has no cure. Asthma treatment is designed to: Control symptoms, Lower the need for quick-relief medicines (like inhalers), Help you keep your lungs healthy and functioning normally, Help you maintain the ability to perform day-to-day activities, Help you get a good night’s sleep, Help you avoid asthma attacks that could lead to an emergency room visit.</item>
        <item>Cleaning and bandaging of any lacerations or abrasions will be done. Removal of the stinger will be performed if the infection is from an insect bite.</item>
        <item>Antidepressants and/or psychotherapy are the mainstays of treatment. Psychiatric hospitalizations may be needed for severe symptoms and for those with suicidal thoughts.</item>
        <item>Type 1 diabetes requires supplemental insulin either as an injection or as an intermittent continuous infusion delivered from an insulin pump. The insulin doses required are dependent on glucose measurements performed during the day. Type 2 diabetes times can often be controlled with weight loss, dietary discretion and exercise.</item>
        <item>Treatment depends on how high the LDL level is and if other risk factors for developing blockage of the arteries (atherosclerosis) are present. Eating healthy foods, exercising more, and losing weight can improve mild elevations of cholesterol.</item>
        <item>Treatment includes salt restriction, loss of excess weight, exercise and, in many cases, medications to reduce the pressure.</item>
        <item>Rest and medications to reverse the fever such as acetaminophen(Tylenol) and/or ibuprofen (Motrin, Advil) are administered to reduce the symptoms. Patients are encouraged to drink plenty of fluids.</item>
        <item>Vigorous oral or intravenous fluids, pain medications and anti-nausea medications are the primary treatments. Most stones less than 6mm in size will pass on their own. Stones that don\'t pass on their own will need to be removed during a cystoscopy or other surgical procedure.</item>
        <item>Treatment is aimed at decreasing the intake of calories while still maintaining a healthy diet, and increasing exercise.</item>
        <item>Sinusitis from allergy is treated with antihistamines, nasal sprays, decongestants or allergy shots.</item>
    </string-array>

</resources>
private int getIndexByValue(String arrayValue){
    String[] diseases = getResources().getStringArray(R.array.diseases);
    return java.util.Arrays.asList(diseases).indexOf(arrayValue);
} 
@Override
    public void onItemClick(AdapterView<?> parent, View view, int position,
            long id) {
        // TODO Auto-generated method stub
        String selectedText = (String) parent.getItemAtPosition(position);
        communicator.respond(getIndexByValue(selectedText));
        // communicator.click();    
    }