Q:

Translate Textview by OnLongClick - Where can I find the used Resource of a textview? 

I'm trying to implement a special textview, where I can translate the content into a different language.  My textviews contains only R.String - Text, so I have the equivalent text in a different language available (I do not have to access a translation server). 
How can I get the current String-Resource (R.string. XY) from a textview?  Is that possible?  Otherwise, how can i solve this problem easily? 
One way would be, to set the text programmaticaly, so I can just ask for a Resource-ID in a own method, which I have to store.  But I'm trying right now to find a good solution with setting the text in layout. 

A:

You can write your own function like this:
textView.setText(R.string. XY);
textView.setTag(new Integer(R.string. XY));

Then get your string resource ID by:
public Integer getStringResourceID(Textview textView){
    return ((Integer)textView.getTag()).intValue();
}

UPDATE:
You can try this to get the string resource id which is set in layout file:
int resourceId = getApplicationContext().getResources().getIdentifier("textViewID", "string", getPackageName());

