I'm trying to hack together an app that displays a overlay for android...
But I'm a bit confused right now about how the views work etc. Any help? Nothing is displaying at all...
Code:
import android.app.Activity;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
public class PageByPage extends Activity {
public void onCreate(Bundle currentState) {
super.onCreate(currentState);
View mView;
setContentView(R.layout.main);
// Create object that refers to main android screen and puts buttons on it.
WindowManager.LayoutParams myScreen = new WindowManager.LayoutParams();
myScreen.width = WindowManager.LayoutParams.WRAP_CONTENT;
myScreen.height = WindowManager.LayoutParams.WRAP_CONTENT;
myScreen.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; // Allow other touches outside the buttons
WindowManager myWin = (WindowManager)getSystemService("window");
//View v = new View(this);
//View mainbtn = new View(R.layout.main);
//setContentView(R.layout.main);
//myWin.addView(v, myScreen);
LayoutInflater l = LayoutInflater.from(this);
// The main buttons
mView = l.inflate(R.layout.main, null);
myWin.addView(mView, myScreen);
}
}