Remove single Object from realm.io android if it still exists
<p>I use realm to store items later shown in a ListView.
The items have a delete button and if the user clicks that button two times, the app crashes, because realm says the object is no longer valid to operate on. Is there a more elegant solution than to just try and catch that exception and ignoring it?</p>

<p>Here is  the code of the onClick method:</p>

<pre><code>@Override
public void onClick(View view) {
    Toast.makeText(context, "Timer " + timer.getUUID() + " was stopped.", Toast.LENGTH_SHORT).show();
    Realm realm = Realm.getDefaultInstance();
    realm.beginTransaction();
    RealmResults&lt;Timer&gt; result = realm.where(Timer.class).equalTo("uuid", timer.getUUID()).findAll();
    result.deleteAllFromRealm();
    realm.commitTransaction();
}
</code></pre>