本文整理汇总了C#中Android.App.Activity类的典型用法代码示例。如果您正苦于以下问题:C# Activity类的具体用法?C# Activity怎么用?C# Activity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Activity类属于Android.App命名空间,在下文中一共展示了Activity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ViewShowcaseStep
public ViewShowcaseStep(Activity activity, int viewId)
{
this.parentActivity = new WeakReference<Activity>(activity);
this.viewId = viewId;
Setup();
}
开发者ID:mattleibow,项目名称:AppShowcase,代码行数:7,代码来源:ViewShowcaseStep.cs
示例2: CriarChamada
public void CriarChamada(Activity activity)
{
isRecording = !isRecording;
if (isRecording)
{
// Cria o INTENT
var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);
// Abre um modal com uma mensagem de voz
voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, "Diga o nome da pessoa");
// Se passar de 5.5s considera que não há mensagem falada
voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 5500);
voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);
// Para chamadas em outras líguas
// voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.German);
// if you wish it to recognise the default Locale language and German
// if you do use another locale, regional dialects may not be recognised very well
voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
activity.StartActivityForResult(voiceIntent, Constants.VOICE);
}
}
开发者ID:Studyxnet,项目名称:BuscaPorVoz,代码行数:27,代码来源:SpeechPage.cs
示例3: ProgressShower
public ProgressShower(Activity activity)
: base(activity)
{
Indeterminate = true;
SetProgressStyle(ProgressDialogStyle.Horizontal);
SetButton("Cancel",_click);
}
开发者ID:TimHanes,项目名称:ContactCleaner,代码行数:7,代码来源:ProgressShower.cs
示例4: ExpendListAdapter
public ExpendListAdapter(Activity activity,
Dictionary<string, List<string> > dictGroup)
{
_dictGroup = dictGroup;
_activity = activity;
_lstGroupID = dictGroup.Keys.ToList();
}
开发者ID:rohan12111,项目名称:SDPHELPSAPP,代码行数:7,代码来源:ExpendListAdapter.cs
示例5: MyVote_ChangeButton
public MyVote_ChangeButton(Activity context, string imgId, ImageView imgView,int position)
{
this.context = context;
imageID = imgId;
imageView = imgView;
this.position = position;
}
开发者ID:kktanpiya,项目名称:kimuraHazuki048,代码行数:7,代码来源:MyVote_ChangeButton.cs
示例6: SystemUiHiderHoneycomb
public SystemUiHiderHoneycomb(Activity activity, View anchorView, int flags)
: base(activity, anchorView, flags)
{
#if __ANDROID_11__
m_ShowFlags = (int)SystemUiFlags.Visible;
m_HideFlags = (int)SystemUiFlags.LowProfile;
m_TestFlags = (int)SystemUiFlags.LowProfile;
if ((m_Flags & FLAG_FULLSCREEN) != 0)
{
// If the client requested fullscreen, add flags relevant to hiding
// the status bar. Note that some of these constants are new as of
// API 16 (Jelly Bean). It is safe to use them, as they are inlined
// at compile-time and do nothing on pre-Jelly Bean devices.
m_ShowFlags |= (int)SystemUiFlags.LayoutFullscreen;
m_HideFlags |= (int)SystemUiFlags.LayoutFullscreen | (int)SystemUiFlags.Fullscreen;
}
if ((m_Flags & FLAG_HIDE_NAVIGATION) != 0)
{
// If the client requested hiding navigation, add relevant flags.
m_ShowFlags |= (int)SystemUiFlags.LayoutHideNavigation;
m_HideFlags |= (int)SystemUiFlags.LayoutHideNavigation
| (int)SystemUiFlags.HideNavigation;
m_TestFlags = (int)SystemUiFlags.HideNavigation;
}
#endif
}
开发者ID:RobSchoenaker,项目名称:MonoDroidToolkit,代码行数:28,代码来源:SystemUiHiderHoneycomb.cs
示例7: BindDataToView
public void BindDataToView(TextView characterCountTextView, Action validate, Activity activity, SuggestionsLayout suggestionsView)
{
Validate = validate;
CharacterCountTextView = characterCountTextView;
Activity = activity;
SuggestionsView = suggestionsView;
}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:7,代码来源:CharacterLimitedSuggestionEditText.cs
示例8: ProtoPadServer
private ProtoPadServer(View window, int? overrideListeningPort = null, string overrideBroadcastedAppName = null)
{
_window = window;
_contextActivity = window.Context as Activity;
_httpServer = new SimpleHttpServer(responseBytes =>
{
var response = "{}";
var remoteCommandDoneEvent = new AutoResetEvent(false);
_contextActivity.RunOnUiThread(() => Response(responseBytes, remoteCommandDoneEvent, ref response));
remoteCommandDoneEvent.WaitOne();
return response;
});
IPAddress broadCastAddress;
using (var wifi = _contextActivity.GetSystemService(Android.Content.Context.WifiService) as WifiManager)
{
_mcLock = wifi.CreateMulticastLock("ProtoPadLock");
_mcLock.Acquire();
broadCastAddress = GetBroadcastAddress(wifi);
}
BroadcastedAppName = overrideBroadcastedAppName ?? String.Format("ProtoPad Service on ANDROID Device {0}", Android.OS.Build.Model);
ListeningPort = overrideListeningPort ?? 8080;
LocalIPAddress = Helpers.GetCurrentIPAddress();
_udpServer = new UdpDiscoveryServer(BroadcastedAppName, String.Format("http://{0}:{1}/", LocalIPAddress, ListeningPort), broadCastAddress);
}
开发者ID:slodge,项目名称:ProtoPad,代码行数:28,代码来源:ProtoPadServer.cs
示例9: PilotListCounterFragment
public PilotListCounterFragment(string title, PilotListAdapter pilotList, Activity parent)
: base()
{
mTitle = title;
mPilotList = pilotList;
mParent = parent;
}
开发者ID:sschocke,项目名称:JGCompanion,代码行数:7,代码来源:PilotListCounterFragment.cs
示例10: OnDraw
//protected override void OnElementChanged(VisualElement oldModel, VisualElement newModel)
//protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
protected override void OnDraw(Canvas canvas)
{
_activity = this.Context as Activity;
ActionBar actionBar = _activity.ActionBar;
if (actionBar.TabCount > 0)
{
ActionBar.Tab tabPrompting = actionBar.GetTabAt(0);
ActionBar.Tab tabActivities = actionBar.GetTabAt(1);
ActionBar.Tab tabReminders = actionBar.GetTabAt(2);
ActionBar.Tab tabMapping = actionBar.GetTabAt(3);
ActionBar.Tab tabSettings = actionBar.GetTabAt(4);
//Set the tab icons
tabPrompting.SetIcon(Resource.Drawable.ic_description_white_24dp);
tabActivities.SetIcon(Resource.Drawable.ic_local_activity_white_24dp);
tabReminders.SetIcon(Resource.Drawable.ic_schedule_white_24dp);
tabMapping.SetIcon(Resource.Drawable.ic_map_white_24dp);
tabSettings.SetIcon(Resource.Drawable.ic_settings_white_24dp);
//Remove the page's title from the tab
tabPrompting.SetText("");
tabActivities.SetText("");
tabReminders.SetText("");
tabMapping.SetText("");
tabSettings.SetText("");
base.OnDraw(canvas);
}
}
开发者ID:FishSaidNo,项目名称:IAB330-CaAPA,代码行数:32,代码来源:CustomTabRenderer.cs
示例11: OnActivityStarted
public void OnActivityStarted(Activity activity)
{
CrossCurrentActivity.Current.Activity = activity;
#if !XTC
HockeyApp.Tracking.StartUsage(activity);
#endif
}
开发者ID:yyy4401,项目名称:MyDriving,代码行数:7,代码来源:MainApplication.cs
示例12: isNetworkConnected
/// <summary>
/// 网络是否联通
/// </summary>
public static bool isNetworkConnected(Activity active)
{
bool net = false;
ConnectivityManager connManager = (ConnectivityManager)active.GetSystemService(Context.ConnectivityService);
// connManager.ActiveNetworkInfo ==null 手机无法连接网络
if (connManager.ActiveNetworkInfo != null)
{
//获得 wifi 连接管理
NetworkInfo networkInfo = connManager.GetNetworkInfo(ConnectivityType.Wifi);
//获得 GPRS 连接管理
NetworkInfo gp = connManager.GetNetworkInfo(ConnectivityType.Mobile);
if (networkInfo != null && networkInfo.IsAvailable != false)
{
//Toast.MakeText(active, "WIFI打开!", ToastLength.Long).Show();
net = true;
}
// gp.IsConnected==false 有信号无网络
if (gp != null && gp.IsConnected != false)
{
//Toast.MakeText(active, "有信号gprs打开!", ToastLength.Long).Show();
net = true;
}
}
else
{
//Toast.MakeText(active, "无法连接到互联网!", ToastLength.Long).Show();
}
return net;
}
开发者ID:eatage,项目名称:AppTest.bak,代码行数:34,代码来源:SysVisitor.cs
示例13: AdvertisementItemListAdapter
public AdvertisementItemListAdapter(Activity context, List<AdvertisementItemShort> advertisementItems, IInfiniteScrollListener infiniteScrollListener) {
this.AdvertisementItems = advertisementItems;
this.context = context;
this.bitmapOperationService = new BitmapOperationService();
this.infiniteScrollListener = infiniteScrollListener;
CalculateSizeForPhotoImageView();
}
开发者ID:MarcinSzyszka,项目名称:MobileSecondHand,代码行数:7,代码来源:AdvertisementItemListAdapter.cs
示例14: MyVote_YesOrNoDialog
public MyVote_YesOrNoDialog(Activity context, string imgId, ImageView imgView,int position)
{
this.context = context;
imageId = imgId;
imageView = imgView;
this.position = position;
}
开发者ID:kktanpiya,项目名称:kimuraHazuki048,代码行数:7,代码来源:MyVote_YesOrNoDialog.cs
示例15: UnbindPopWindow
public UnbindPopWindow (Activity _activity,GuardianInfoListItem item)
{
activity = _activity;
LayoutInflater inflater = (LayoutInflater) activity.GetSystemService (Context.LayoutInflaterService);
contentView = inflater.Inflate(Resource.Layout.customunbinddialogLayout, null);
ContentView = contentView;
Width = 900;
Height = 450;
Focusable = true;
OutsideTouchable = true;
//Update ();
SetBackgroundDrawable (new ColorDrawable());
AnimationStyle = Resource.Style.AnimationPreview;
var btn_confirm = contentView.FindViewById<Button> (Resource.Id.btn_confirm);
btn_confirm.Click += (sender, e) =>
{
Dismiss();
if(UnBindEventHandler != null)
UnBindEventHandler(item);
};
var btn_cancel = contentView.FindViewById<Button> (Resource.Id.btn_cancel);
btn_cancel.Click += (sender, e) =>
{
Dismiss();
};
DismissEvent += (sender, e) =>
{
BackgroundAlpha(1f);
};
}
开发者ID:lq-ever,项目名称:CommunityCenter,代码行数:35,代码来源:UnbindPopWindow.cs
示例16: HorizontalMenuLabel
public HorizontalMenuLabel (Activity activity) : base (activity)
{
defaultTextColor = TextColor;
Gravity = GravityFlags.Center;
TextColor = CustomColors.DarkColor;
TextSize = Sizes.GetRealSize (9);
}
开发者ID:Gerhic,项目名称:Need2Park,代码行数:7,代码来源:HorizontalMenuLabel.cs
示例17: CloseProgressDialog
public static void CloseProgressDialog(Activity context) {
if (!context.IsFinishing && _mProgressDialog != null)
{
_mProgressDialog.Dismiss();
}
_mProgressDialog = null;
}
开发者ID:Xushlin,项目名称:Xamarin-For-Android,代码行数:7,代码来源:DialogUitls.cs
示例18: AvatarAdapter
public AvatarAdapter(Activity context, ProfileViewModel viewModel)
{
this.context = context;
this.viewModel = viewModel;
viewModel.Avatars.CollectionChanged += (sender, e) => context.RunOnUiThread (NotifyDataSetChanged);
}
开发者ID:richardboegli,项目名称:KinderChat,代码行数:7,代码来源:AvatarAdapter.cs
示例19: OnActivityResumed
internal void OnActivityResumed(Activity activity)
{
if (activity is IFrameworkActivity)
{
_navigationProvider.ActivityResumed((IFrameworkActivity)activity);
}
}
开发者ID:ryanhorath,项目名称:Rybird.Framework,代码行数:7,代码来源:AndroidApp.cs
示例20: OnElementChanged
protected override void OnElementChanged (ElementChangedEventArgs<Page> e)
{
base.OnElementChanged (e);
if (e.OldElement != null || Element == null)
return;
try {
activity = this.Context as Activity;
view = activity.LayoutInflater.Inflate(Resource.Layout.CameraLayout, this, false);
cameraType = CameraFacing.Back;
textureView = view.FindViewById<TextureView> (Resource.Id.textureView);
textureView.SurfaceTextureListener = this;
takePhotoButton = view.FindViewById<global::Android.Widget.Button> (Resource.Id.takePhotoButton);
takePhotoButton.Click += TakePhotoButtonTapped;
switchCameraButton = view.FindViewById<global::Android.Widget.Button> (Resource.Id.switchCameraButton);
switchCameraButton.Click += SwitchCameraButtonTapped;
toggleFlashButton = view.FindViewById<global::Android.Widget.Button> (Resource.Id.toggleFlashButton);
toggleFlashButton.Click += ToggleFlashButtonTapped;
AddView (view);
} catch (Exception ex) {
//Xamarin.Insights.Report (ex);
}
}
开发者ID:santiagohdzb,项目名称:FormsDemo,代码行数:29,代码来源:CameraPage.cs
注:本文中的Android.App.Activity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论