|
first of all thanks for ur attention.
i have it in "activity_main.axml" :
<android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabhostN"
android:layout_width="match_parent"
android:layout_height="match_parent">
And the mTabHost isnot nulll in
mTabHost = FindViewById<FragmentTabHost>(Resource.Id.tabhostN );
Or
Possible to give me and C# xamarin example for doing the same i have done?
any further question?
|
|
|
|
|
Did you actually check the value of this variable at run time? It matters not what you write in your source code, the only way to be sure it works is to check it at the time of error. If it is not that variable that causes the error then it must be one of the others.
I also notice that you have this code within a try/catch block, but you eat the exception. This is really bad practice and leads to situations just such as this. Exceptions provide useful information, so make proper use of them.
|
|
|
|
|
i have used this for sample for that the catch is not complete.
at runtime the mtabHost is not null.
i have breakepoint in
mTabHost.AddTab(spec);
and the error occured in here.
thanks in advanced!
|
|
|
|
|
Then you need to establish what value is causing the exception. We cannot guess it from the information you have provided.
|
|
|
|
|
may i give ur the whole project for downloading?
thanks in advanced!
|
|
|
|
|
Sorry, no. You need to do the debugging and provide the required information.
|
|
|
|
|
thanks
but i have done that but cannot help!
do y have any sample ?
|
|
|
|
|
Sorry, I don't use Xamarin, and that is not really the solution; if you find another sample and that one does not work, what then? If you aspire to be a developer then you really need to practice diagnosing problems, even if you need help solving them.
|
|
|
|
|
thanks for ur advice
But the error is exact there and i dont know how to solve that~
|
|
|
|
|
I have tried to explain how: you use your debugger to step through the code and look to see what variable is not being set up correctly. You can only solve it by collecting all the information around the time of error.
|
|
|
|
|
Thanks i have done that!
I should change :
mTabHost.AddTab(spec);
To :
mTabHost.Setup(this, SupportFragmentManager, Resource.Id.tabFrameLayout);
mTabHost.AddTab(spec, Java.Lang.Class.FromType(typeof(Fragment1)), null);
end of story
That is all!
|
|
|
|
|
Yes, it always helps to read the documentation.
|
|
|
|
|
I want to add a method by which I can directly print report from the printer on local network.
my server which printer is connected to is 192.168.1.50
(my printer isnt Bluetooth OR Wifi one.)
I also have seen PrinterShare but it looks like it requires a client software running on a PC connected to the printer.
I wanna to do it directly to server which has printer connected and shared!
I got this code but no USE!!!
I wanna to do that in (xamarin C#)
try
{
Socket sock = new Socket("192.168.1.222", 9100);
PrintWriter oStream = new PrintWriter(sock.getOutputStream());
oStream.println("HI,test from Android Device");
oStream.println("\n\n\n");
oStream.close();
sock.close();
}
catch (UnknownHostException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
Thanks in advacned!
|
|
|
|
|
jojoba20 wrote: I got this code but no USE!!! You need to explain why it is no use. Did you get some sort of error, and if so please edit your question and add the details.
|
|
|
|
|
it needs wifi printer but mine is only connected to PC(server) and the printer is shared
|
|
|
|
|
jojoba20 wrote: it needs wifi printer but mine is only connected to PC I don't think there is a lot that we can do to help with that.
|
|
|
|
|
thanks for reply
do u have any example for what i wanna do?
forget what i have searched!
thnaks in advanced
|
|
|
|
|
|
|
how can i change to vibrate mode when screen is on and change to general when screen is on...
android
|
|
|
|
|
|
Have you tried something like:
AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
am.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
how to make an player jump in forward direction with on touchlistern
|
|
|
|
|
Hello everyone,
0xFFFF0000
btn.setBackgroundColor(0xFFFF0000);
I want to put that color in an array but don't know what datatype I will put to that
that does't mean that I can't do it
|
|
|
|