DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: webb123
今日帖子: 3
在线用户: 3
导航: 论坛 -> 移动应用开发 斑竹:flyers,iamdream  
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/5 9:58:49
标题:
android下获得事件问题 浏览:3263
加入我的收藏
楼主:   Myimg:=TJImageView.JavaClass.init(SharedActivity);
 Myimg.setImageBitmap(Myjbitmap);
先搞了一个图片显示出来。
我想给它加个click事件怎么加?或者APP可以获得所有的点击消息?
谢谢
----------------------------------------------
-
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/7 9:33:48
1楼: 在java中可以用
  @Override  
   public boolean onTouch(View v, MotionEvent event) {  }
来实现。在delphi中如何来实现!!!
.
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/7 9:49:43
2楼: Androidapi.JNI.GraphicsContentViewText.JView_OnTouchListener
我敢肯定,你一定不相信这就是解决办法。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/7 14:39:39
3楼: 是建一个Androidapi.JNI.GraphicsContentViewText.JView_OnTouchListener
对象,而后将这个对象设到Myimg.setOnTouchListener里。
处理程序写到什么地方?
----------------------------------------------
-
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/7 15:17:47
4楼: 我这样写
 type
 tMyListener=class(TJavaGenericImport<JView_OnTouchListenerClass,JView_OnTouchListener>)
   function onTouch(v: JView; event: JMotionEvent): Boolean; cdecl;//加override;出错
 end;

function tMyListener.onTouch(v: JView; event: JMotionEvent): Boolean; cdecl;
begin
if event.getAction=TJMotionEvent.JavaClass.ACTION_UP then
 begin
     CallInUiThread (
 procedure
 begin
   form1.Image1.Position.X:=Form1.Image1.Position.X+5;
  end);
 end;
  Result:=True;
end;


  Mylistener:=tmylistener.Wrap((SharedActivity as ILocalObject).GetObjectID);
  Myimg.setOnTouchListener(Mylistener);

运行卡死,我想可能是建listener的方法不对。又找不到怎么建的例子。
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/8 16:52:38
5楼: Mylistener 居然可以这样建立?你牛。

CallInUiThread 不建议使用。
建议用 DELPHI 规定的线程同步。

XXX.Wrap(YYY
要求 YYY 必须是可以转换为 XXX 的。
也就是 YYY 的类型 和 XXX 的类型,你可以转换。
比如
Int32 和 UInt32 就可以互相转换。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 ltsh (禁卫军) ▲▲▲△△ -
普通会员
2017/11/9 9:28:16
6楼: 请问这个wrap中要怎么写,网上完全找不到相关信息
还有我自己写的涵数会被执行吗
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/9 12:30:22
7楼: 我完全不懂 为什么warp 用在这个地方?
我在 5 楼已经 解释了他的用法,你觉得,他的用法和你的需求一致吗?
----------------------------------------------
(C)(P)Flying Wang
作者:
男 ltsh (禁卫军) ▲▲▲△△ -
普通会员
2017/11/9 14:13:11
8楼: 那用什么来创建这个监听对象,或者说是初始化
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/9 14:17:10
9楼: 低级问题,不予回复。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/9 16:15:16
10楼: 问题再低对于不会的都是难题。
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/9 17:48:55
11楼: 关于 调用 JNI JAR java 的说明和注意事项,调用第 靠写不下了
http://www.2pascal.com/forum.php?mod=viewthread&tid=1384&fromuid=4
(出处: 2Pascal-新时代的Pascal)



别告诉我,这篇文章你没看过。
答案就在里头。
信不信由你。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/10 14:12:07
12楼: unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  FMX.Controls.Presentation, FMX.StdCtrls,



  androidapi.jni.widget,
  androidapi.jni.graphicscontentviewtext;

type
  TForm1 = class(TForm)
    btn1: TButton;
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
type
  TViewOnTouchListener =  class(TJView_OnTouchListener)
    function onTouch(v: JView; event: JMotionEvent): Boolean; cdecl;
  end;






var
  Form1: TForm1;

implementation

{$R *.fmx}



procedure TForm1.btn1Click(Sender: TObject);
var
  v:JImageView;
  t:TViewOnTouchListener;
begin
  v.setOnTouchListener(t);
end;

{ View_OnTouchListener }

function TViewOnTouchListener.onTouch(v: JView; event: JMotionEvent): Boolean;
begin
  ///////
  ///
  ///
end;

end.
没测试
----------------------------------------------
Delphi业余爱好者
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/10 14:53:18
13楼: @爱像一阵风 安卓怎样给通知加自定义按钮比如关闭按钮(用来关闭APP)?能给一个小例子么?
----------------------------------------------
http://mcool.appinn.me/
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/10 20:55:24
14楼: 愛像一陣風,非常感谢!
有两个问题,一是t:TViewOnTouchListener =  class(TJView_OnTouchListener)和v.setOnTouchListener(t);类型不一样,一个是类一个是接口。会报错。
二是这个t不创建能用吗?怎么创建?

再次谢谢!
----------------------------------------------
-
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/10 22:05:15
15楼: 好像有点意思了,Debug调试提示invke error:method'onTouch'not found。
可我加了函数了啊。
----------------------------------------------
-
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/10 23:10:56
16楼: 初始化肯定要的,我那代码是大概意思
----------------------------------------------
Delphi业余爱好者
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/11 16:20:18
17楼: 谢谢了,看了后很有启发。现在出现找不到ontouch是什么意思。
----------------------------------------------
-
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/11 21:20:01
18楼: 我的原程序
 type
TViewOnTouchListener=class(TJavaLocal,JView_OnTouchListener)
private
Fparent:TForm1;
public
constructor Create(parent: TForm1);
function onTouch(v: JView; event: JMotionEvent): Boolean; cdecl;
end;

constructor TViewOnTouchListener.Create(parent: TForm1);
begin
 inherited Create();
 Self.Fparent:=parent;
end;

function TViewOnTouchListener.onTouch(v: JView; event: JMotionEvent)
: Boolean;
begin
inherited;
 CallInUiThread (
 procedure
 begin
   ShowMessage('ok')
 end);
Result:=false;
end;

t:TViewOnTouchListener;
    t:=TViewOnTouchListener.Create(Form1);
    Myimg.setOnTouchListener(t);

帮看看是什么问题
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/12 12:27:20
19楼: 楼主 15 楼 说的话 好高深莫测啊。
即便配上 18 楼的内容,也是 云里雾里。
大概只有天上的神仙能知道发生类似什么吧。
毕竟人家神仙会 掐指一算。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/12 13:16:58
20楼: 愛像一陣風,谢谢了,搞出来了。各类事件都可以了。
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/12 17:16:26
21楼: 楼主 发生错误的地方 不说,保密
怎么解决就更不会说了。

楼主只会说 发生了 XXX 错误。

就比如楼主 打 119:我家着火了。
119 问:地址。
楼主:我家啊,你白痴啊。
后来,楼主告诉 119:你们不用来了。火灭了。
结果 119 不乐意了:您家火是不是真灭了,万一还有火灾隐患怎么办。
就算真灭了,也要记录火灾发生的原因,避免再次发生。
结果楼主嫌119麻烦,直接挂了电话。
过了几天,警察找上门来。因为楼主不配合防火,被请去喝茶了。
楼主当时就急了:你们既然能找来,干嘛问我家地址?
你看,我不告诉你们,你们还是能找来的。说明我有先见之明。
同理,我不告诉你们发生火灾的原因,你们也一定能自己知道。怎么能说我不配合呢?
----------------------------------------------
(C)(P)Flying Wang
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/12 22:28:02
22楼: 楼上的,你能说点有用的东西吗?
我最后一次的程序是对的,没有问题。只是开始用的手机版本不对。
----------------------------------------------
-
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/13 8:58:29
23楼: 除了 9 楼,老子什么内容没用处?

2 楼内容不是你要的答案?

5 和 7 楼没告诉你用错了函数?
当时明明告诉你 Warp 的用法,你就是当看不见。

我 11 楼发的帖子,没叫你看过吗?
就算是你第一次看到,里头明明有答案,你不相信而已。

以上个个都有用处,你不承认就算了。

说实在的,一个 delphi 标准的类,只不过这个类还 继承了一个 接口 而已,你 TMD 就不会新建对象了?
Form Button 也是这种的 继承了一个或多个接口。
你新建这些对象咋就没这问题?
所以说 问题太低级。
TStringList TMemoryStream 这些简单的类,也就是没有继承接口而已。
TStreamAdapter TInterfacedPersistent 这些也是继承了接口的。
建立他们的方法,你是不是也不会?

18楼代码,没什么大问题,所以 15 楼内容和 18 楼代码一起理解,就根本理解不了了。
当然,我脑子也笨。不如楼主聪明,人家说的内容,只能给非常聪明的神仙看。

既然楼主自己的手机版本不对(怎么个不对,就知不知道了)
难道别人的手机就一定会版本对(什么版本才叫对)吗?
万一很多用户,特别是关键用户的手机版本一样不对,楼主该这么办?

然后楼主又打119 结果 又被请去喝茶了。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 ltshdp (禁卫军) ▲▲▲△△ -
普通会员
2017/11/13 21:34:53
24楼: 哈哈,有没有用自己清楚,一个只会说风凉说的人在那里也是没有用的,祝你永远没用。谢谢!!!
----------------------------------------------
-
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/14 10:31:40
25楼: diystar (diystar)  没明白你的意思
----------------------------------------------
Delphi业余爱好者
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/14 11:36:29
26楼: @爱像一阵风 比如市面上主流的音乐播放器,会在通知栏给出一个通知,通知上会有暂停、下一首、上一首、关闭等按钮
----------------------------------------------
http://mcool.appinn.me/
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/14 11:41:37
27楼: 楼上 你先弄出一个通知出来,按钮先别考虑。
弄出一个通知之后,再说。
当然肯定不是 DELPHI 内置的那种简单的文字通知。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/14 12:21:49
28楼: 通知早搞出来了:

var
  Notif: JNotification;
  Intent : Jintent;
  PendingIntent:JPendingIntent;

procedure TRemoteServiceDM.AndroidServiceCreate(Sender: TObject);
begin
  Notif:= TJNotification.Create;
  Notif.icon := TAndroidHelper.Context.getApplicationInfo.icon;
  Notif.number:=1;

  Intent := TAndroidHelper.Context.getPackageManager().getLaunchIntentForPackage(TAndroidHelper.Context.getPackageName());
  Intent.setFlags(TJIntent.JavaClass.FLAG_ACTIVITY_SINGLE_TOP or TJIntent.JavaClass.FLAG_ACTIVITY_CLEAR_TOP);
  PendingIntent:=TJPendingIntent.JavaClass.getActivity(TAndroidHelper.Context, 0, Intent, TJPendingIntent.JavaClass.FLAG_UPDATE_CURRENT);
  Notif.setLatestEventInfo(TAndroidHelper.Context,strToJCharSequence('mcool'),StrToJCharSequence(''),PendingIntent);
end;
----------------------------------------------
http://mcool.appinn.me/
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/14 13:34:28
29楼: diystar (diystar)   没搞过这个不知道啊
----------------------------------------------
Delphi业余爱好者
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/14 13:34:33
29楼: 你这仅仅是给 EMB 的简单文字通知,加了几个参数而已。
你下一步,给这个通知 加一个 View。
做不到,就不要继续了。
----------------------------------------------
(C)(P)Flying Wang
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/14 14:31:44
30楼: diystar (diystar)

delphi好像目前还不能做到有按钮

    //procedure setOnClickPendingIntent(viewId: Integer; pendingIntent: JPendingIntent); cdecl;
    //procedure setPendingIntentTemplate(viewId: Integer; pendingIntentTemplate: JPendingIntent); cdecl;
 

上面这两个是要设置按钮事件的 现在是注释状态

http://blog.csdn.net/wxdjaqgs/article/details/44561101
----------------------------------------------
Delphi业余爱好者
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/14 16:37:21
31楼: @爱像一阵风
就用本帖提到的 onTouch 可以吗?

另外我也不知道怎样给通知加一个 View ..
----------------------------------------------
http://mcool.appinn.me/
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/14 16:59:37
32楼: diystar (diystar)  好像不可以啊,下面是我的源码你看下,不过有问题

procedure TForm1.Button1Click(Sender: TObject);
var
  MyNotification: TNotification;
  RemoteViews:JRemoteViews;
  intentpi,PendingIntent:JPendingIntent;
  intent,intent2:JIntent;
  Notif: JNotification;
  NotificationManager:JNotificationManager;
begin
  Notif:= TJNotification.Create;
  Notif.icon := TAndroidHelper.Context.getApplicationInfo.icon;
  Notif.number:=1;


  RemoteViews:=Tjremoteviews.JavaClass.init(TAndroidHelper.Context.getPackageName,GetResourceID('Button1'));
  RemoteViews.setTextViewText(GetResourceID('Button1'),StrToJCharSequence('首都机场精品无线'));//资源文件不对
  RemoteViews.setTextViewText(GetResourceID('Button1'),StrToJCharSequence('已免费接入'));//资源文件不对
  RemoteViews.setOnClickFillInIntent(GetResourceID('Button1'),intent);//资源文件不对


  intent:=Tjintent.JavaClass.init;
  intent.putExtra(stringtojstring('btnid'),1);
  intentpi := TJPendingIntent.JavaClass.getBroadcast(
  Tandroidhelper.Activity,0,intent,TJPendingIntent.JavaClass.FLAG_UPDATE_CURRENT);

  intent2:=Tjintent.JavaClass.init;
  intent2.setClass(tandroidhelper.Activity,MainActivity.getClass);
  intent2.setFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK and TJIntent.JavaClass.FLAG_ACTIVITY_CLEAR_TASK);
  PendingIntent:= TJPendingIntent.JavaClass.getActivity(TAndroidHelper.Activity,0,intent2,TJPendingIntent.JavaClass.FLAG_UPDATE_CURRENT);

  Builder := TJNotificationCompat_Builder.JavaClass.init(Tandroidhelper.Activity);
  Builder.setOngoing(False);
  Builder.setAutoCancel(False);

 // Builder.setContent(RemoteViews);加这个报错
  Builder.setTicker(StrToJCharSequence('正在XXX'));
  Builder.setSmallIcon(SharedActivityContext.getApplicationInfo.icon);
  Notif := Builder.build;
  Notif.defaults := TJNotification.JavaClass.DEFAULT_SOUND;
  Notif.flags := TJNotification.JavaClass.FLAG_NO_CLEAR;
  Notif.contentIntent := PendingIntent;
  NotificationManager := TJNotificationManager.Wrap((TAndroidHelper.Context.getSystemService(TJContext.JavaClass.NOTIFICATION_SERVICE) as ILocalObject).GetObjectID);
  NotificationManager.notify(1,notif);
end; 



这个是根据java翻译过来的 有问题的你在改改

http://blog.csdn.net/wxdjaqgs/article/details/44561101
----------------------------------------------
Delphi业余爱好者
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/14 17:06:42
33楼: 谢谢
----------------------------------------------
http://mcool.appinn.me/
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/14 19:19:14
34楼: TAndroidHelper.GetResourceID('tv_up', 'id');
----------------------------------------------
(C)(P)Flying Wang
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/16 10:57:59
35楼: diystar (diystar)  你QQ多少  我高出按钮了,事件没法搞
----------------------------------------------
Delphi业余爱好者
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/16 13:42:21
36楼: @愛像一陣風
1405166351 有按钮就好办

楼主在20楼不是说各种事件都可以了?
----------------------------------------------
http://mcool.appinn.me/
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/16 13:54:27
37楼:  diystar (diystar) 搞好了  我把源码给你 你QQ?
此帖子包含附件:
PNG 图像
大小:184.9K
----------------------------------------------
Delphi业余爱好者
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/16 14:05:42
38楼: 源码附件

xe10.2
此帖子包含附件:jiuk_2017111614542.zip 大小:38.6K
----------------------------------------------
Delphi业余爱好者
作者:
男 ltsh (禁卫军) ▲▲▲△△ -
普通会员
2017/11/16 15:04:26
39楼: 普通view用18楼的就可以。这个不知道了。等学习完,我下载风的程序试试。
我用手机看了一下,这个用的事件方式和我18楼的不一样。但只要方向对一定没问题。回去我研究一下。
祝,共同进步!
----------------------------------------------
-
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/16 15:42:19
40楼: 我用 10.1.2 编译了一下38楼源码,用猩猩助手模拟器闪退。有几个按钮的话,如何安排按钮的位置?另外,如果要用图片的话
----------------------------------------------
http://mcool.appinn.me/
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/16 15:48:40
41楼: diystar (diystar)  那是因为你没有加载那几个xml文件

源码里面不是有个图片吗,把那几个文件按照图片加进去
----------------------------------------------
Delphi业余爱好者
作者:
男 diystar (diystar) ★☆☆☆☆ -
普通会员
2017/11/16 15:52:26
42楼: 好的。如何用图片显示呢?比如播放、前进、后退、关闭等等
----------------------------------------------
http://mcool.appinn.me/
作者:
男 jiuk (愛像一陣風) ★☆☆☆☆ -
普通会员
2017/11/16 15:54:39
43楼:   procedure setImageViewBitmap(viewId: Integer; bitmap: JBitmap); cdecl;

[JavaSignature('android/widget/RemoteViews')]
JTRemoteViews = interface(JObject)
  ['{C4C8FF03-5E94-4821-9401-A3DCA8A1119A}']
  procedure addView(viewId: Integer; nestedView: JTRemoteViews); cdecl;
  function apply(context: JContext; parent: JViewGroup): JView; cdecl;
  function clone: JTRemoteViews; cdecl;
  function describeContents: Integer; cdecl;
  function getLayoutId: Integer; cdecl;
  function getPackage: JString; cdecl;
  function onLoadClass(clazz: Jlang_Class): Boolean; cdecl;
  procedure reapply(context: JContext; v: JView); cdecl;
  procedure removeAllViews(viewId: Integer); cdecl;
  procedure setAccessibilityTraversalAfter(viewId: Integer; nextId: Integer); cdecl;
  procedure setAccessibilityTraversalBefore(viewId: Integer; nextId: Integer); cdecl;
  procedure setBitmap(viewId: Integer; methodName: JString; value: JBitmap); cdecl;
  procedure setBoolean(viewId: Integer; methodName: JString; value: Boolean); cdecl;
  procedure setBundle(viewId: Integer; methodName: JString; value: JBundle); cdecl;
  procedure setByte(viewId: Integer; methodName: JString; value: Byte); cdecl;
  procedure setChar(viewId: Integer; methodName: JString; value: Char); cdecl;
  procedure setCharSequence(viewId: Integer; methodName: JString; value: JCharSequence); cdecl;
  procedure setChronometer(viewId: Integer; base: Int64; format: JString; started: Boolean); cdecl;
  procedure setContentDescription(viewId: Integer; contentDescription: JCharSequence); cdecl;
  procedure setDisplayedChild(viewId: Integer; childIndex: Integer); cdecl;
  procedure setDouble(viewId: Integer; methodName: JString; value: Double); cdecl;
  procedure setEmptyView(viewId: Integer; emptyViewId: Integer); cdecl;
  procedure setFloat(viewId: Integer; methodName: JString; value: Single); cdecl;
  procedure setIcon(viewId: Integer; methodName: JString; value: JIcon); cdecl;
  procedure setImageViewBitmap(viewId: Integer; bitmap: JBitmap); cdecl;
  procedure setImageViewIcon(viewId: Integer; icon: JIcon); cdecl;
  procedure setImageViewResource(viewId: Integer; srcId: Integer); cdecl;
  procedure setImageViewUri(viewId: Integer; uri: Jnet_Uri); cdecl;
  procedure setInt(viewId: Integer; methodName: JString; value: Integer); cdecl;
  procedure setIntent(viewId: Integer; methodName: JString; value: JIntent); cdecl;
  procedure setLabelFor(viewId: Integer; labeledId: Integer); cdecl;
  procedure setLong(viewId: Integer; methodName: JString; value: Int64); cdecl;
  procedure setOnClickFillInIntent(viewId: Integer; fillInIntent: JIntent); cdecl;
  procedure setOnClickPendingIntent(viewId: Integer; pendingIntent: JTPendingIntent); cdecl;
  procedure setPendingIntentTemplate(viewId: Integer; pendingIntentTemplate: JTPendingIntent); cdecl;
  procedure setProgressBar(viewId: Integer; max: Integer; progress: Integer; indeterminate: Boolean); cdecl;
  procedure setRelativeScrollPosition(viewId: Integer; offset: Integer); cdecl;
  procedure setRemoteAdapter(appWidgetId: Integer; viewId: Integer; intent: JIntent); cdecl; overload;//Deprecated
  procedure setRemoteAdapter(viewId: Integer; intent: JIntent); cdecl; overload;
  procedure setScrollPosition(viewId: Integer; position: Integer); cdecl;
  procedure setShort(viewId: Integer; methodName: JString; value: SmallInt); cdecl;
  procedure setString(viewId: Integer; methodName: JString; value: JString); cdecl;
  procedure setTextColor(viewId: Integer; color: Integer); cdecl;
  procedure setTextViewCompoundDrawables(viewId: Integer; left: Integer; top: Integer; right: Integer; bottom: Integer); cdecl;
  procedure setTextViewCompoundDrawablesRelative(viewId: Integer; start: Integer; top: Integer; end_: Integer; bottom: Integer); cdecl;
  procedure setTextViewText(viewId: Integer; text: JCharSequence); cdecl;
  procedure setTextViewTextSize(viewId: Integer; units: Integer; size: Single); cdecl;
  procedure setUri(viewId: Integer; methodName: JString; value: Jnet_Uri); cdecl;
  procedure setViewPadding(viewId: Integer; left: Integer; top: Integer; right: Integer; bottom: Integer); cdecl;
  procedure setViewVisibility(viewId: Integer; visibility: Integer); cdecl;
  procedure showNext(viewId: Integer); cdecl;
  procedure showPrevious(viewId: Integer); cdecl;
  procedure writeToParcel(dest: JParcel; flags: Integer); cdecl;
end;



显示按钮,图片 进度条 都可以
----------------------------------------------
Delphi业余爱好者
作者:
男 wang_80919 (Flying Wang) ★☆☆☆☆ -
普通会员
2017/11/16 17:51:01
44楼: 这就是 jni 开发,语法用 DELPHI 而已。
其他的一律和 JAVA 开发 安卓一样。
不仅仅可以用 xml 布局。
你就算不用 xml ,纯写代码,一样能完成布局。
当然 网上很少有不写 XML 的代码。
因为 XML 是可以用设计器形成的。
但是 不用 XML 其实就是动态建立控件一个意思。
----------------------------------------------
(C)(P)Flying Wang
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行136.7188毫秒 RSS