Skip to content

Instantly share code, notes, and snippets.

@f2prateek
Created January 20, 2013 19:21
Show Gist options
  • Save f2prateek/4580983 to your computer and use it in GitHub Desktop.
Save f2prateek/4580983 to your computer and use it in GitHub Desktop.
Custom inner class in R.java?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TextView
android:id="@+DropDownList/SelectBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world" />
</RelativeLayout>
package com.f2prateek.test;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends Activity {
TextView mTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTextView = (TextView)findViewById(R.DropDownList.SelectBox);
}
@Override
protected void onResume() {
super.onResume();
mTextView.setText(getWindowManager().getDefaultDisplay().getRotation() + "");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment