{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/android-runtime/issues/854","repository_url":"https://api.github.com/repos/NativeScript/android-runtime","labels_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/854/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/854/comments","events_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/854/events","html_url":"https://github.com/NativeScript/android-runtime/issues/854","id":262000520,"number":854,"title":"Issue while calling activity","user":{"login":"NickIliev","id":18008302,"avatar_url":"https://avatars2.githubusercontent.com/u/18008302?v=4","gravatar_id":"","url":"https://api.github.com/users/NickIliev","html_url":"https://github.com/NickIliev","followers_url":"https://api.github.com/users/NickIliev/followers","following_url":"https://api.github.com/users/NickIliev/following{/other_user}","gists_url":"https://api.github.com/users/NickIliev/gists{/gist_id}","starred_url":"https://api.github.com/users/NickIliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickIliev/subscriptions","organizations_url":"https://api.github.com/users/NickIliev/orgs","repos_url":"https://api.github.com/users/NickIliev/repos","events_url":"https://api.github.com/users/NickIliev/events{/privacy}","received_events_url":"https://api.github.com/users/NickIliev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-02T07:23:05Z","updated_at":"2017-10-02T08:42:22Z","closed_at":null,"author_association":"NONE","body":"_From @patelhr on September 30, 2017 3:34_\n\nI have crated method to call activity methods.but my existing application activity methods contain context and calling some other java virtual methods.So is there any solution for this problem?\r\n\r\nI am calling method using this \r\nvar test = new com.tns.TestObject();\r\nconsole.log(test.doSomething());\r\nIt will call java method but it don't have activity context and calling failed to virtual method.\r\nSo is there any way in native script to call activity method with context?\n\n_Copied from original issue: NativeScript/nativescript-angular#1016_"},"comment":{"url":"https://api.github.com/repos/NativeScript/android-runtime/issues/comments/333474294","html_url":"https://github.com/NativeScript/android-runtime/issues/854#issuecomment-333474294","issue_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/854","id":333474294,"user":{"login":"Pip3r4o","id":10464986,"avatar_url":"https://avatars3.githubusercontent.com/u/10464986?v=4","gravatar_id":"","url":"https://api.github.com/users/Pip3r4o","html_url":"https://github.com/Pip3r4o","followers_url":"https://api.github.com/users/Pip3r4o/followers","following_url":"https://api.github.com/users/Pip3r4o/following{/other_user}","gists_url":"https://api.github.com/users/Pip3r4o/gists{/gist_id}","starred_url":"https://api.github.com/users/Pip3r4o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pip3r4o/subscriptions","organizations_url":"https://api.github.com/users/Pip3r4o/orgs","repos_url":"https://api.github.com/users/Pip3r4o/repos","events_url":"https://api.github.com/users/Pip3r4o/events{/privacy}","received_events_url":"https://api.github.com/users/Pip3r4o/received_events","type":"User","site_admin":false},"created_at":"2017-10-02T08:42:22Z","updated_at":"2017-10-02T08:42:22Z","author_association":"MEMBER","body":"Hey @patelhr please provide a sample project in a github repo. \r\n\r\nIt is not clear how you've done the integration, but it sounds like you cannot use `com.cameracountmodule.activity.CameraActivity` in JavaScript because there is no metadata generated for your existing android application's classes.\r\n\r\nIf that is indeed your case, you can workaround by using reflection. It should look something like this:\r\n\r\n```javascript\r\nlet cameraActivityClass = java.lang.Class.forName(\"com.cameracountmodule.activity.CameraActivity\");\r\n\r\nngOnInit() {\r\n console.log(\"forground\"+application.android.foregroundActivity)\r\n let intent: android.content.Intent = new android.content.Intent(\r\n application.android.foregroundActivity,\r\n cameraActivityClass);\r\n \r\n application.android.foregroundActivity.startActivityForResult(intent);\r\n}\r\n```"}}
{"actor":{"display_login":"Pip3r4o"}}