Question: I can not set the name of the selected object in "BarraNome" how can I do?

```
public class MainActivity2Activity extends Activity {

String[] lista1 = { "JAN", "FEB", "MAR", "APR", "MAY", "JUNE", "JULY","AUG", "SEPT", "OCT", "NOV", "DEC" };

Button BarraNome;
private ListView lista;
private ArrayAdapter arrayAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_activity2);

    lista = (ListView) findViewById(R.id.listacompleta);
    arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, lista1);
    lista.setAdapter(arrayAdapter);

    lista.setOnItemClickListener(new AdapterView.OnItemClickListener(){
        @Override
        public void onItemClick(AdapterView<?> av, View v, int pos,long id){

```

Look this part of code! 

```
            //This code works//
            Toast.makeText(getApplicationContext(),""+ lista1[pos], Toast.LENGTH_LONG).show();

            //Don't works, why?//
            BarraNome.setText(""+ lista1[pos]);
        }});}}

```

Please help me

Answer: 
You may need to call out to `expr`, depending on your mystery shell:

```
d1="2015-03-31" d2="2015-04-01"
if [ "$d1" = "$d2" ]; then
    echo "same day"
elif expr "$d1" "<" "$d2" >/dev/null; then
    echo "d1 is earlier than d2"
else
    echo "d1 is later than d2"
fi

```

```
d1 is earlier than d2

```

---

The `test` command (or it's alias `[`) only implements string equality and inequality operators. When you give the (non-bash) shell this command:

```
[ "$d1" > "$d2" ]

```

the `> "$d2"` part is treated as stdout redirection. A zero-length file named (in this case) "2015-04-01" is created, and the conditional command becomes

```
[ "$d1" ]

```

and as the variable is non-empty, that evaluates to a success status.

The file is zero size because the `[` command generates no standard output.
You can use `date +%s -d your_date` to get the number of seconds since a fixed instance (1970-01-01, 00:00 UTC) called "epoch". Once you get that it's really easy to do almost anything with dates. And there are a couple of options to convert a number back to date too.