I’m working my way through Android Programming by Big Nerd Ranch, but using RemObjects C# to do it. I’ve managed to get through to Chapter 5 and everything works well. But it is taking quite a while to discover how to convert the Java/Android code into something C# compatible. I’ve looked through everything I can find on this site and Google, and cannot find something that would help me understand the equivalence to something such as
Intent i = new Intent(QuizActivity.this, CheatActivity.class);
Is there a wiki or a help file I have simply missed that would help me out? I would save hours of time with a simple reference that would help me to know what the same code would be in C#.
The first one is a bit trickier; In java nested classes inherit the “this” from their outside class, but C# you have to add a parameter to the constructor like:
class OuterClass {
QuizActivity {
private OuterClass owner;
public QuizActivity(OuterClass owner) { this.owner =owner; }
so you have the outer class this instance, then use “outer” in the first parameter.
CheatActivity.class translates to typeof(CheatActivity)